Quellcode durchsuchen

Fixed examples that relied on raycasting invisible objects.

Mr.doob vor 10 Jahren
Ursprung
Commit
c062737cc5

+ 1 - 2
examples/canvas_interactive_voxelpainter.html

@@ -84,8 +84,7 @@
 				var geometry = new THREE.PlaneBufferGeometry( 1000, 1000 );
 				geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 
-				plane = new THREE.Mesh( geometry );
-				plane.visible = false;
+				plane = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { visible: false } ) );
 				scene.add( plane );
 
 				objects.push( plane );

+ 1 - 2
examples/webgl_interactive_draggablecubes.html

@@ -101,9 +101,8 @@
 
 				plane = new THREE.Mesh(
 					new THREE.PlaneBufferGeometry( 2000, 2000, 8, 8 ),
-					new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true } )
+					new THREE.MeshBasicMaterial( { visible: false } )
 				);
-				plane.visible = false;
 				scene.add( plane );
 
 				renderer = new THREE.WebGLRenderer( { antialias: true } );

+ 1 - 2
examples/webgl_interactive_voxelpainter.html

@@ -98,8 +98,7 @@
 				var geometry = new THREE.PlaneBufferGeometry( 1000, 1000 );
 				geometry.applyMatrix( new THREE.Matrix4().makeRotationX( - Math.PI / 2 ) );
 
-				plane = new THREE.Mesh( geometry );
-				plane.visible = false;
+				plane = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { visible: false } ) );
 				scene.add( plane );
 
 				objects.push( plane );