Browse Source

webgl_interactive_lines_visible_sphere

alexan0308 10 years ago
parent
commit
c2ebad446e
1 changed files with 7 additions and 7 deletions
  1. 7 7
      examples/webgl_interactive_lines.html

+ 7 - 7
examples/webgl_interactive_lines.html

@@ -52,9 +52,9 @@
 				var geometry = new THREE.SphereGeometry( 5 );
 				var material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
 
-				//sphereInter = new THREE.Mesh( geometry, material );
-				//sphereInter.visible = false;
-				//scene.add( sphereInter );
+				sphereInter = new THREE.Mesh( geometry, material );
+				sphereInter.visible = false;
+				scene.add( sphereInter );
 
 				var geometry = new THREE.Geometry();
 
@@ -111,7 +111,7 @@
 				scene.add( parentTransform );
 
 				raycaster = new THREE.Raycaster();
-				raycaster.linePrecision = 1;
+				raycaster.linePrecision = 3;
 
 				renderer = new THREE.WebGLRenderer( { antialias: true } );
 				renderer.setClearColor( 0xf0f0f0 );
@@ -189,8 +189,8 @@
 					currentIntersected = intersects[ 0 ].object;
 					currentIntersected.material.linewidth = 5;
 
-					//sphereInter.visible = true;
-					//sphereInter.position.copy( intersects[ 0 ].point );
+					sphereInter.visible = true;
+					sphereInter.position.copy( intersects[ 0 ].point );
 
 				} else {
 
@@ -202,7 +202,7 @@
 
 					currentIntersected = undefined;
 
-					//sphereInter.visible = false;
+					sphereInter.visible = false;
 
 				}