2
0

OrthographicCamera.html 4.8 KB

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