CameraHelper.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Object3D] &rarr; [page:Line] &rarr; [page:LineSegments] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. 用于模拟相机视锥体的辅助对象.它使用 [page:LineSegments] 来模拟相机视锥体.<br /><br />
  14. [name] must be a child of the scene.
  15. </p>
  16. <h2>代码示例</h2>
  17. <code>
  18. const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
  19. const helper = new THREE.CameraHelper( camera );
  20. scene.add( helper );
  21. </code>
  22. <h2>例子</h2>
  23. <p>
  24. [example:webgl_camera WebGL / camera]<br/>
  25. [example:webgl_geometry_extrude_splines WebGL / extrude / splines]
  26. </p>
  27. <h2>构造函数</h2>
  28. <h3>[name]( [param:Camera camera] )</h3>
  29. <p>
  30. [page:Camera camera] -- 被模拟的相机.<br /><br />
  31. 为指定相机创建一个新的相机辅助对象 [Name] .
  32. </p>
  33. <h2>属性</h2>
  34. <p>请到基类 [page:LineSegments] 页面查看公共属性.</p>
  35. <h3>[property:Camera camera]</h3>
  36. <p>被模拟的相机.</p>
  37. <h3>[property:Object pointMap]</h3>
  38. <p>包含用于模拟相机的点.</p>
  39. <h3>[property:Object matrix]</h3>
  40. <p>请参考相机的世界矩阵 [page:Object3D.matrixWorld camera.matrixWorld].</p>
  41. <h3>[property:Object matrixAutoUpdate]</h3>
  42. <p>
  43. 请查看 [page:Object3D.matrixAutoUpdate]. 这里设置为 *false* 表示辅助对象
  44. 使用相机的 [page:Object3D.matrixWorld matrixWorld].
  45. </p>
  46. <h2>方法</h2>
  47. <p>请到基类 [page:LineSegments] 页面查看公共方法.</p>
  48. <h3>[method:undefined dispose]()</h3>
  49. <p>
  50. 用于辅助对象销毁内部创建的 [page:Line.material material] 和 [page:Line.geometry geometry] 。
  51. </p>
  52. <h3>[method:this setColors]( [param:Color frustum], [param:Color cone], [param:Color up], [param:Color target], [param:Color cross] )</h3>
  53. <p>
  54. 定义辅助对象的颜色。
  55. </p>
  56. <h3>[method:undefined update]()</h3>
  57. <p>基于相机的投影矩阵更新辅助对象.</p>
  58. <h2>源码</h2>
  59. <p>
  60. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  61. </p>
  62. </body>
  63. </html>