Browse Source

Octree: improved tree visualization

WestLangley 7 years ago
parent
commit
aad3a51345
2 changed files with 5 additions and 4 deletions
  1. 4 3
      examples/js/Octree.js
  2. 1 1
      examples/webgl_octree.html

+ 4 - 3
examples/js/Octree.js

@@ -119,8 +119,9 @@
 		
 		if ( this.scene ) {
 			
-			this.visualGeometry = new THREE.BoxGeometry( 1, 1, 1 );
-			this.visualMaterial = new THREE.MeshBasicMaterial( { color: 0xFF0066, wireframe: true, wireframeLinewidth: 1 } );
+			var helper = new THREE.BoxHelper( new THREE.Mesh( new THREE.BoxGeometry( 1, 1, 1 ) ), 0xff0066 );
+			this.visualGeometry = helper.geometry;
+			this.visualMaterial = helper.material;
 			
 		}
 		
@@ -773,7 +774,7 @@
 		
 		if ( this.tree.scene ) {
 			
-			this.visual = new THREE.Mesh( this.tree.visualGeometry, this.tree.visualMaterial );
+			this.visual = new THREE.LineSegments( this.tree.visualGeometry, this.tree.visualMaterial );
 			this.visual.scale.set( this.radiusOverlap * 2, this.radiusOverlap * 2, this.radiusOverlap * 2 );
 			this.visual.position.copy( this.position );
 			this.tree.scene.add( this.visual );

+ 1 - 1
examples/webgl_octree.html

@@ -28,7 +28,7 @@
 				mesh,
 				meshes = [],
 				meshesSearch = [],
-				meshCountMax = 1000,
+				meshCountMax = 100,
 				radius = 500,
 				radiusMax = radius * 10,
 				radiusMaxHalf = radiusMax * 0.5,