BoxHelper.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE html>
  2. <html lang="zh">
  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. <p class="desc">
  14. 用于展示对象世界轴心对齐的包围盒的辅助对象.
  15. 注意:要想能正常运行,目标对象必须包含 [page:Geometry] 或 [page:BufferGeometry] ,
  16. 所以当目标对象是精灵 [page:Sprite Sprites] 时将不能正常运行.
  17. </p>
  18. <h2>例子</h2>
  19. <div>[example:webgl_helpers WebGL / helpers]</div>
  20. <div>[example:webgl_loader_nrrd WebGL / loader / nrrd]</div>
  21. <div>[example:webgl_buffergeometry_drawcalls advanced / buffergeometry / drawcalls]</div>
  22. <code>
  23. var sphere = new THREE.SphereGeometry();
  24. var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );
  25. var box = new THREE.BoxHelper( object, 0xffff00 );
  26. scene.add( box );
  27. </code>
  28. <h2>构造函数</h2>
  29. <h3>[name]( [param:Object3D object], [param:Color color] )</h3>
  30. <p>
  31. [page:Object3D object] -- (可选的) 被展示世界轴心对齐的包围盒的对象.<br />
  32. [page:Color color] -- (可选的) 线框盒子的16进制颜色值. 默认为 0xffff00.<br /><br />
  33. 创建一个新的线框盒子包围指定的对象. 内部使用 [page:Box3.setFromObject]
  34. 方法来计算尺寸. 注意:此线框盒子将包围对象的所有子对象.
  35. </p>
  36. <h2>属性</h2>
  37. <p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
  38. <h2>方法</h2>
  39. <p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
  40. <h3>[method:null update]()</h3>
  41. <p>
  42. 更新辅助对象的几何体,与目标对象尺寸
  43. 保持一致, 包围目标对象所有子对象. 请查看 [page:Box3.setFromObject].
  44. </p>
  45. <h3>[method:BoxHelper setFromObject]( [param:Object3D object] )</h3>
  46. <p>
  47. [page:Object3D object] - 用于创建辅助对象的目标 [page:Object3D] 对象.<br /><br />
  48. 更新指定对象的线框盒子.
  49. </p>
  50. <h2>源码</h2>
  51. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  52. </body>
  53. </html>