BoundingBoxHelper.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="list.js"></script>
  7. <script src="page.js"></script>
  8. <link type="text/css" rel="stylesheet" href="page.css" />
  9. </head>
  10. <body>
  11. [page:Mesh] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">A helper object to show the world-axis-aligned bounding box for an object.</div>
  14. <h2>Example</h2>
  15. <code>var hex = 0xff0000;
  16. var sphereMaterial = new THREE.MeshLambertMaterial( {color: 0x00ff00} );
  17. var sphere = new THREE.Mesh( new THREE.SphereGeometry( 30, 12, 12), sphereMaterial );
  18. scene.add( sphere );
  19. var bbox = new THREE.BoundingBoxHelper( sphere, hex );
  20. bbox.update();
  21. scene.add( bbox );
  22. </code>
  23. <div>Note that this helper will create a wireframe [page:Mesh] object with a [page:BoxGeometry]; the resulting bounding box object will therefore have face diagonals. You may want to use [page:BoxHelper], which generates a [page:Line] object without face diagonals.</div>
  24. <h2>Constructor</h2>
  25. <h3>[name]( [page:Object3D object], [page:Number hex] )</h3>
  26. <div>
  27. [page:Object3D object] -- Object3D -- the object3D to show the world-axis-aligned boundingbox.<br />
  28. [page:Number hex] -- hexadecimal value that defines the box's color. Default is 0x888888.
  29. </div>
  30. <h2>Properties</h2>
  31. <div>See the base [page:Mesh] class for common properties.</div>
  32. <h3>[property:Object3D object]</h3>
  33. <div>Contains the object3D to show the world-axis-aligned boundingbox.</div>
  34. <h3>[property:Box3 box]</h3>
  35. <div>Contains the bounding box of the object.</div>
  36. <h2>Methods</h2>
  37. <div>See the base [page:LineSegments] class for common methods.</div>
  38. <h3>[method:null update]()</h3>
  39. <div>Updates the BoundingBoxHelper based on the object property.</div>
  40. <h2>Source</h2>
  41. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  42. </body>
  43. </html>