BoundingBoxHelper.html 1.5 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. <h2>Constructor</h2>
  23. <h3>[name]([page:Object3D object], [page:Number hex])</h3>
  24. <div>
  25. object -- Object3D -- the object3D to show the world-axis-aligned boundingbox.<br />
  26. hex -- hexadecimal value to define color ex:0x888888
  27. </div>
  28. <div>
  29. This creates an line object to the boundingbox.
  30. </div>
  31. <h2>Properties</h2>
  32. <h3>[property:Object3D object]</h3>
  33. <div>
  34. Contains the object3D to show the world-axis-aligned boundingbox.
  35. </div>
  36. <h3>[property:Box3 box]</h3>
  37. <div>
  38. Contains the bounding box of the object.
  39. </div>
  40. <h2>Methods</h2>
  41. <h3>[method:null update]()</h3>
  42. <div>
  43. Updates the BoundingBoxHelper based on the object property.
  44. </div>
  45. <h2>Source</h2>
  46. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  47. </body>
  48. </html>