Skip to content

Commit 0f81064

Browse files
committed
Examples: Implemented simpler floor clipping technique in xr examples.
1 parent ef03bdc commit 0f81064

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

examples/webxr_xr_dragging.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@
6565
controls.update();
6666

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

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

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

137-
// clipping
138-
139-
const floorClipping = new THREE.Plane( new THREE.Vector3( 0, 1, 0 ) );
140-
renderer.clippingPlanes = [ floorClipping ];
141-
142136
// controllers
143137

144138
controller1 = renderer.xr.getController( 0 );

examples/webxr_xr_haptics.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
controls.update();
9393

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

0 commit comments

Comments
 (0)