CameraHelper.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!DOCTYPE html>
  2. <html lang="en">
  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. This helps with visualizing what a camera contains in its frustum.<br />
  14. It visualizes the frustum of a camera using a [page:LineSegments].
  15. </p>
  16. <h2>Code Example</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>Examples</h2>
  23. <p>
  24. [example:webgl_camera WebGL / camera]<br/>
  25. [example:webgl_geometry_extrude_splines WebGL / extrude / splines]
  26. </p>
  27. <h2>Constructor</h2>
  28. <h3>[name]( [param:Camera camera] )</h3>
  29. <p>
  30. [page:Camera camera] -- The camera to visualize.<br /><br />
  31. This create a new [Name] for the specified camera.
  32. </p>
  33. <h2>Properties</h2>
  34. <p>See the base [page:LineSegments] class for common properties.</p>
  35. <h3>[property:Camera camera]</h3>
  36. <p>The camera being visualized.</p>
  37. <h3>[property:Object pointMap]</h3>
  38. <p>This contains the points used to visualize the camera.</p>
  39. <h3>[property:Object matrix]</h3>
  40. <p>Reference to the [page:Object3D.matrixWorld camera.matrixWorld].</p>
  41. <h3>[property:Object matrixAutoUpdate]</h3>
  42. <p>
  43. See [page:Object3D.matrixAutoUpdate]. Set to *false* here as the helper is using the
  44. camera's [page:Object3D.matrixWorld matrixWorld].
  45. </p>
  46. <h2>Methods</h2>
  47. <p>See the base [page:LineSegments] class for common methods.</p>
  48. <h3>[method:CameraHelper dispose]()</h3>
  49. <p>
  50. Disposes of the internally-created [page:Line.material material] and [page:Line.geometry geometry] used by this helper.
  51. </p>
  52. <h3>[method:null update]()</h3>
  53. <p>Updates the helper based on the projectionMatrix of the camera.</p>
  54. <h2>Source</h2>
  55. <p>
  56. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  57. </p>
  58. </body>
  59. </html>