BoundingBoxHelper.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../../list.js"></script>
  6. <script src="../../../page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="../../../page.css" />
  8. </head>
  9. <body>
  10. [page:Mesh] &rarr;
  11. <h1>[name]</h1>
  12. <div class="desc">A helper object to show the world-axis-aligned bounding box for an object.</div>
  13. <h2>Example</h2>
  14. <code>var hex = 0xff0000;
  15. var sphereMaterial = new THREE.MeshLambertMaterial( {color: 0x00ff00} );
  16. var sphere = new THREE.Mesh( new THREE.SphereGeometry( 30, 12, 12), sphereMaterial );
  17. scene.add( sphere );
  18. var bbox = new THREE.BoundingBoxHelper( sphere, hex );
  19. bbox.update();
  20. scene.add( bbox );
  21. </code>
  22. <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>
  23. <h2>Constructor</h2>
  24. <h3>[name]([page:Object3D object], [page:Number hex])</h3>
  25. <div>
  26. object -- Object3D -- the object3D to show the world-axis-aligned boundingbox.<br />
  27. hex -- hexadecimal value to define color ex:0x888888
  28. </div>
  29. <div>
  30. This creates an line object to the boundingbox.
  31. </div>
  32. <h2>Properties</h2>
  33. <h3>[property:Object3D object]</h3>
  34. <div>
  35. Contains the object3D to show the world-axis-aligned boundingbox.
  36. </div>
  37. <h3>[property:Box3 box]</h3>
  38. <div>
  39. Contains the bounding box of the object.
  40. </div>
  41. <h2>Methods</h2>
  42. <h3>[method:null update]()</h3>
  43. <div>
  44. Updates the BoundingBoxHelper based on the object property.
  45. </div>
  46. <h2>Source</h2>
  47. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  48. </body>
  49. </html>