Skip to content

Commit

Permalink
Examples: Implemented simpler floor clipping technique in xr examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Apr 27, 2023
1 parent ef03bdc commit 0f81064
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions examples/webxr_xr_dragging.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@
controls.update();

const floorGeometry = new THREE.PlaneGeometry( 6, 6 );
const floorMaterial = new THREE.ShadowMaterial( { opacity: 0.25 } );
const floorMaterial = new THREE.ShadowMaterial( { opacity: 0.25, blending: THREE.CustomBlending, transparent: false } );
const floor = new THREE.Mesh( floorGeometry, floorMaterial );
floor.rotation.x = - Math.PI / 2;
floor.receiveShadow = true;
floor.renderOrder = 2;
scene.add( floor );

scene.add( new THREE.HemisphereLight( 0x808080, 0x606060 ) );
Expand Down Expand Up @@ -134,11 +133,6 @@

document.body.appendChild( XRButton.createButton( renderer ) );

// clipping

const floorClipping = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ) );
renderer.clippingPlanes = [ floorClipping ];

// controllers

controller1 = renderer.xr.getController( 0 );
Expand Down
2 changes: 1 addition & 1 deletion examples/webxr_xr_haptics.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
controls.update();

const floorGeometry = new THREE.PlaneGeometry( 4, 4 );
const floorMaterial = new THREE.ShadowMaterial( { opacity: 0.25 } );
const floorMaterial = new THREE.ShadowMaterial( { opacity: 0.25, blending: THREE.CustomBlending, transparent: false } );
const floor = new THREE.Mesh( floorGeometry, floorMaterial );
floor.rotation.x = - Math.PI / 2;
floor.receiveShadow = true;
Expand Down

0 comments on commit 0f81064

Please sign in to comment.