BoundingBoxHelper.html 1.8 KB

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