OrthographicCamera.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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:Object3D] &rarr; [page:Camera] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. Camera that uses [link:https://en.wikipedia.org/wiki/Orthographic_projection orthographic projection].<br /><br />
  15. In this projection mode, an object's size in the rendered image stays constant
  16. regardless of its distance from the camera.<br /><br />
  17. This can be useful for rendering 2D scenes and UI elements, amongst other things.
  18. </p>
  19. <h2>Example</h2>
  20. <p>[example:canvas_camera_orthographic camera / orthographic ]</p>
  21. <p>[example:webgl_camera camera ]</p>
  22. <p>[example:webgl_interactive_cubes_ortho interactive / cubes / ortho ]</p>
  23. <p>[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic ]</p>
  24. <p>[example:webgl_postprocessing_advanced postprocessing / advanced ]</p>
  25. <p>[example:webgl_postprocessing_dof2 postprocessing / dof2 ]</p>
  26. <p>[example:webgl_postprocessing_godrays postprocessing / godrays ]</p>
  27. <p>[example:webgl_rtt rtt ]</p>
  28. <p>[example:webgl_shaders_tonemapping shaders / tonemapping ]</p>
  29. <p>[example:webgl_shadowmap shadowmap ]</p>
  30. <p>[example:webgl_terrain_dynamic terrain / dynamic ]</p>
  31. <code>var camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 );
  32. scene.add( camera );</code>
  33. <h2>Constructor</h2>
  34. <h3>[name]( [param:Number left], [param:Number right], [param:Number top], [param:Number bottom], [param:Number near], [param:Number far] )</h3>
  35. <p>
  36. left — Camera frustum left plane.<br />
  37. right — Camera frustum right plane.<br />
  38. top — Camera frustum top plane.<br />
  39. bottom — Camera frustum bottom plane.<br />
  40. near — Camera frustum near plane.<br />
  41. far — Camera frustum far plane.<br /><br />
  42. Together these define the camera's [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
  43. </p>
  44. <h2>Properties</h2>
  45. <p>
  46. See the base [page:Camera] class for common properties.<br>
  47. Note that after making changes to most of these properties you will have to call
  48. [page:OrthographicCamera.updateProjectionMatrix .updateProjectionMatrix] for the changes to take effect.
  49. </p>
  50. <h3>[property:Float bottom]</h3>
  51. <p>Camera frustum bottom plane.</p>
  52. <h3>[property:Float far]</h3>
  53. <p>
  54. Camera frustum far plane. Default is *2000*.<br /><br />
  55. The valid range is between the current value of the [page:.near near] plane and infinity.
  56. </p>
  57. <h3>[property:Boolean isOrthographicCamera]</h3>
  58. <p>
  59. Used to test whether this or derived classes are OrthographicCameras. Default is *true*.<br /><br />
  60. This should not be changed as it is used internally by the renderer for optimisation.
  61. </p>
  62. <h3>[property:Float left]</h3>
  63. <p>Camera frustum left plane.</p>
  64. <h3>[property:Float near]</h3>
  65. <p>
  66. Camera frustum near plane. Default is *0.1*.<br /><br />
  67. The valid range is between 0 and the current value of the [page:.far far] plane.
  68. Note that, unlike for the [page:PerspectiveCamera], *0* is a valid value for an
  69. OrthographicCamera's near plane.
  70. </p>
  71. <h3>[property:Float right]</h3>
  72. <p>Camera frustum right plane.</p>
  73. <h3>[property:Float top]</h3>
  74. <p>Camera frustum top plane.</p>
  75. <h3>[property:Object view]</h3>
  76. <p>Set by [page:OrthographicCamera.setViewOffset setViewOffset]. Default is *null*.</p>
  77. <h3>[property:number zoom]</h3>
  78. <p>Gets or sets the zoom factor of the camera. Default is *1*.</p>
  79. <h2>Methods</h2>
  80. <p>See the base [page:Camera] class for common methods.</p>
  81. <h3>[method:null setViewOffset]( [param:Float fullWidth], [param:Float fullHeight], [param:Float x], [param:Float y], [param:Float width], [param:Float height] )</h3>
  82. <p>
  83. fullWidth — full width of multiview setup<br />
  84. fullHeight — full height of multiview setup<br />
  85. x — horizontal offset of subcamera<br />
  86. y — vertical offset of subcamera<br />
  87. width — width of subcamera<br />
  88. height — height of subcamera<br /><br />
  89. Sets an offset in a larger [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum].
  90. This is useful for multi-window or multi-monitor/multi-machine setups.
  91. For an example on how to use it see [page:PerspectiveCamera.setViewOffset PerspectiveCamera].
  92. </p>
  93. <h3>[method:null clearViewOffset]()</h3>
  94. <p>
  95. Removes any offset set by the .setViewOffset method.
  96. </p>
  97. <h3>[method:null updateProjectionMatrix]()</h3>
  98. <p>
  99. Updates the camera projection matrix. Must be called after any change of parameters.
  100. </p>
  101. <h3>[method:JSON toJSON]()</h3>
  102. <p>
  103. Return the camera's data in JSON format.
  104. </p>
  105. <h2>Source</h2>
  106. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  107. </body>
  108. </html>