فهرست منبع

Examples: Implemented simpler floor clipping technique in xr examples.

Mr.doob 2 سال پیش
والد
کامیت
0f81064166
2فایلهای تغییر یافته به همراه2 افزوده شده و 8 حذف شده
  1. 1 7
      examples/webxr_xr_dragging.html
  2. 1 1
      examples/webxr_xr_haptics.html

+ 1 - 7
examples/webxr_xr_dragging.html

@@ -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 ) );
@@ -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 );

+ 1 - 1
examples/webxr_xr_haptics.html

@@ -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;