Browse Source

Use BoxLineGeometry in webvr examples.

Mr.doob 7 years ago
parent
commit
83787b6994
2 changed files with 10 additions and 7 deletions
  1. 5 3
      examples/webvr_ballshooter.html
  2. 5 4
      examples/webvr_cubes.html

+ 5 - 3
examples/webvr_ballshooter.html

@@ -24,6 +24,8 @@
 		<script src="../build/three.js"></script>
 		<script src="js/vr/WebVR.js"></script>
 
+		<script src="js/geometries/BoxLineGeometry.js"></script>
+
 		<script>
 
 			var container;
@@ -57,9 +59,9 @@
 
 				camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 0.1, 10 );
 
-				room = new THREE.Mesh(
-					new THREE.BoxBufferGeometry( 6, 6, 6, 8, 8, 8 ),
-					new THREE.MeshBasicMaterial( { color: 0x808080, wireframe: true } )
+				room = new THREE.LineSegments(
+					new THREE.BoxLineGeometry( 6, 6, 6, 10, 10, 10 ),
+					new THREE.LineBasicMaterial( { color: 0x808080 } )
 				);
 				room.geometry.translate( 0, 3, 0 );
 				scene.add( room );

+ 5 - 4
examples/webvr_cubes.html

@@ -22,9 +22,10 @@
 	<body>
 
 		<script src="../build/three.js"></script>
-
 		<script src="js/vr/WebVR.js"></script>
 
+		<script src="js/geometries/BoxLineGeometry.js"></script>
+
 		<script>
 
 			var clock = new THREE.Clock();
@@ -71,9 +72,9 @@
 				crosshair.position.z = - 2;
 				camera.add( crosshair );
 
-				room = new THREE.Mesh(
-					new THREE.BoxBufferGeometry( 6, 6, 6, 8, 8, 8 ),
-					new THREE.MeshBasicMaterial( { color: 0x404040, wireframe: true } )
+				room = new THREE.LineSegments(
+					new THREE.BoxLineGeometry( 6, 6, 6, 10, 10, 10 ),
+					new THREE.LineBasicMaterial( { color: 0x808080 } )
 				);
 				room.position.y = 3;
 				scene.add( room );