Bläddra i källkod

revert boxhelper example, add box3 example

jotaro-sama 6 år sedan
förälder
incheckning
7878fbfb4d
2 ändrade filer med 32 tillägg och 27 borttagningar
  1. 4 26
      docs/api/en/helpers/BoxHelper.html
  2. 28 1
      docs/api/en/math/Box3.html

+ 4 - 26
docs/api/en/helpers/BoxHelper.html

@@ -28,32 +28,10 @@
 
 
 		<code>
-		// Creating the object whose bounding box we want to compute
-		var sphereGeom = new THREE.SphereGeometry();
-		var sphereObject = new THREE.Mesh( 
-			sphereGeom, 
-			new THREE.MeshBasicMaterial( 0xff0000 ) 
-		);
-
-		// Creating the helper and displaying it in the scene
-		var helper = new THREE.BoxHelper( sphereObject, 0xffff00 );
-		scene.add( helper );
-
-		// Creating the actual bounding box 
-		// (on which we can test intersection with other Box3 objects)
-		sphereObject.geometry.computeBoundingBox();
-		var BBox = new THREE.Box3(
-			sphereObject.geometry.boundingBox.min,
-  			sphereObject.geometry.boundingBox.max
-		);
-
-		// Moving the sphere
-		sphereObject.position.set( 7, 7, 7 );
-
-		// Updating both the bounding box and the helper
-		// (to repeat each time the object is moved, rotated or scaled) 
-		BBox.copy( sphereObject.geometry.boundingBox ).applyMatrix4( sphereObject.matrixWorld );
-		helper.update();
+			var sphere = new THREE.SphereGeometry();
+			var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );
+			var box = new THREE.BoxHelper( object, 0xffff00 );
+			scene.add( box );
 		</code>
 
 

+ 28 - 1
docs/api/en/math/Box3.html

@@ -15,7 +15,34 @@
 			the world-axis-aligned bounding boxes for objects. 
 		</p>
 
-
+		
+		<h2>Example</h2>
+
+		<code>
+		// Creating the object whose bounding box we want to compute
+		var sphereGeom = new THREE.SphereGeometry();
+		var sphereObject = new THREE.Mesh( 
+			sphereGeom, 
+			new THREE.MeshBasicMaterial( 0xff0000 ) 
+		);
+
+		// Creating the actual bounding box with Box3
+		sphereObject.geometry.computeBoundingBox();
+		var BBox = new THREE.Box3(
+			sphereObject.geometry.boundingBox.min,
+  			sphereObject.geometry.boundingBox.max
+		);
+
+		// Moving the sphere
+		sphereObject.position.set( 7, 7, 7 );
+
+		// Updating the bounding box
+		// (to repeat each time the object is moved, rotated or scaled) 
+		BBox.copy( sphereObject.geometry.boundingBox ).applyMatrix4( sphereObject.matrixWorld );
+		</code>
+
+
+		
 		<h2>Constructor</h2>