BoxHelper.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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:LineSegments] &rarr;
  12. <h1>[name]</h1>
  13. <div class="desc">Helper object to show a bounding box around an object.</div>
  14. <h2>Example</h2>
  15. <div>[example:webgl_helpers WebGL / helpers]</div>
  16. <div>[example:webgl_loader_nrrd WebGL / loader / nrrd]</div>
  17. <div>[example:webgl_buffergeometry_drawcalls advanced / buffergeometry / drawcalls]</div>
  18. <code>
  19. var sphere = new THREE.SphereGeometry();
  20. var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );
  21. var box = new THREE.BoxHelper( object, 0xffff00 );
  22. scene.add( box );
  23. </code>
  24. <h2>Constructor</h2>
  25. <h3>[name]( [page:Object3D object], [page:Color color] )</h3>
  26. <div>
  27. [page:Object3D object] -- the object3D to show the world-axis-aligned boundingbox.<br />
  28. [page:Color color] -- hexadecimal value that defines the box's color. Default is 0xffff00.<br /><br />
  29. Creates a new wireframe box that bounds the passed object. Internally this uses [page:Box3.setFromObject]
  30. to calculate the dimensions. Note that this includes any children.
  31. </div>
  32. <h2>Properties</h2>
  33. <div>See the base [page:LineSegments] class for common properties.</div>
  34. <h2>Methods</h2>
  35. <div>See the base [page:LineSegments] class for common methods.</div>
  36. <h3>[method:null update]( [page:Object3D object] )</h3>
  37. <div>
  38. Updates the helper's geometry to match the dimensions of the
  39. of the passed object, including any children. See [page:Box3.setFromObject].
  40. </div>
  41. <h2>Source</h2>
  42. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  43. </body>
  44. </html>