CameraHelper.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. It
  14. visualizes the frustum of a camera using a [page:LineSegments].<br /><br />
  15. [name] must be a child of the scene.
  16. </p>
  17. <h2>Code Example</h2>
  18. <code>
  19. const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
  20. const helper = new THREE.CameraHelper( camera );
  21. scene.add( helper );
  22. </code>
  23. <h2>Examples</h2>
  24. <p>
  25. [example:webgl_camera WebGL / camera]<br />
  26. [example:webgl_geometry_extrude_splines WebGL / extrude / splines]
  27. </p>
  28. <h2>Constructor</h2>
  29. <h3>[name]( [param:Camera camera] )</h3>
  30. <p>
  31. [page:Camera camera] -- The camera to visualize.<br /><br />
  32. This create a new [Name] for the specified camera.
  33. </p>
  34. <h2>Properties</h2>
  35. <p>See the base [page:LineSegments] class for common properties.</p>
  36. <h3>[property:Camera camera]</h3>
  37. <p>The camera being visualized.</p>
  38. <h3>[property:Object pointMap]</h3>
  39. <p>This contains the points used to visualize the camera.</p>
  40. <h3>[property:Object matrix]</h3>
  41. <p>Reference to the [page:Object3D.matrixWorld camera.matrixWorld].</p>
  42. <h3>[property:Object matrixAutoUpdate]</h3>
  43. <p>
  44. See [page:Object3D.matrixAutoUpdate]. Set to `false` here as the helper is
  45. using the camera's [page:Object3D.matrixWorld matrixWorld].
  46. </p>
  47. <h2>Methods</h2>
  48. <p>See the base [page:LineSegments] class for common methods.</p>
  49. <h3>[method:undefined dispose]()</h3>
  50. <p>
  51. Frees the GPU-related resources allocated by this instance. Call this
  52. method whenever this instance is no longer used in your app.
  53. </p>
  54. <h3>
  55. [method:this setColors]( [param:Color frustum], [param:Color cone], [param:Color up], [param:Color target], [param:Color cross] )
  56. </h3>
  57. <p>Defines the colors of the helper.</p>
  58. <h3>[method:undefined update]()</h3>
  59. <p>Updates the helper based on the projectionMatrix of the camera.</p>
  60. <h2>Source</h2>
  61. <p>
  62. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  63. </p>
  64. </body>
  65. </html>