1
0

PerspectiveCamera.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE html>
  2. <html lang="ko">
  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:Camera] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. [link:https://en.wikipedia.org/wiki/Perspective_(graphical) perspective projection]을 사용하는 카메라입니다.<br /><br />
  14. 이 투영 모드는 사람의 눈으로 보는 방식을 모방하여 설계되었습니다. 3D 장면을 렌더링하는데 가장 널리 쓰이는 투영 모드입니다.
  15. </p>
  16. <h2>코드 예제</h2>
  17. <code>
  18. const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 );
  19. scene.add( camera );
  20. </code>
  21. <h2>예제</h2>
  22. <p>
  23. [example:webgl_animation_skinning_blending animation / skinning / blending ]<br />
  24. [example:webgl_animation_skinning_morph animation / skinning / morph ]<br />
  25. [example:webgl_effects_stereo effects / stereo ]<br />
  26. [example:webgl_interactive_cubes interactive / cubes ]<br />
  27. [example:webgl_loader_collada_skinning loader / collada / skinning ]
  28. </p>
  29. <h2>생성자</h2>
  30. <h3>[name]( [param:Number fov], [param:Number aspect], [param:Number near], [param:Number far] )</h3>
  31. <p>
  32. fov — 카메라 절두체 수직 시야.<br />
  33. aspect — 카메라 절두체 종횡비.<br />
  34. near — 카메라 절두체 근평면.<br />
  35. far — 카메라 절두체 원평면.<br /><br />
  36. 카메라의 [link:https://en.wikipedia.org/wiki/Viewing_frustum viewing frustum]을 정의합니다.
  37. </p>
  38. <h2>프로퍼티</h2>
  39. <p>
  40. 일반 프로퍼티는 기본 [page:Camera] 클래스를 참고하세요.<br>
  41. 대부분의 이 프로퍼티들은 수정한 후에 반드시 변경된 효과 적용을 위해
  42. [page:PerspectiveCamera.updateProjectionMatrix .updateProjectionMatrix]를 호출해야 하는 점을 주의하세요.
  43. </p>
  44. <h3>[property:Float aspect]</h3>
  45. <p>카메라 절두체 종횡비, 대부분의 경우 화면 너비 / 화면 높이 입니다. 기본값은 *1* (정사각형 화면)입니다.</p>
  46. <h3>[property:Float far]</h3>
  47. <p>
  48. 카메라 절두체 원평면입니다. 기본값은 *2000*입니다.<br /><br />
  49. [page:.near near](근평면)의 현재값보다 커야 합니다.
  50. </p>
  51. <h3>[property:Float filmGauge]</h3>
  52. <p>큰 축에 사용되는 필름 크기입니다. 기본값은 35(밀리미터)입니다. .filmOffset을 0이 아닌 값으로 설정하지 않는 한 이 파라미터는 투영 매트릭스에 영향을 주지 않습니다.
  53. </p>
  54. <h3>[property:Float filmOffset]</h3>
  55. <p>.filmGauge와 동일한 장치의 수평 오프센터 오프셋. 기본값은 *0*입니다.</p>
  56. <h3>[property:Float focus]</h3>
  57. <p>입체 투시 및 필드 깊이 효과에 사용되는 객체 거리.
  58. 이 파라미터는 [page:StereoCamera]를 사용하지 않는 한 투영 매트릭스에 영향을 주지 않습니다.
  59. 기본값은 *10*입니다.
  60. </p>
  61. <h3>[property:Float fov]</h3>
  62. <p>카메라 아래부터 위까지, 도 단위로 표시되는 수직 시야입니다. 기본값은 *50*입니다.</p>
  63. <h3>[property:Boolean isPerspectiveCamera]</h3>
  64. <p>
  65. Read-only flag to check if a given object is of type [name].
  66. </p>
  67. <h3>[property:Float near]</h3>
  68. <p>
  69. 카메라 절두체 근평면입니다. 기본값은 *0.1*입니다.<br /><br />
  70. 유효 범위는 0보다 크고 현재 [page:.far far](원평면) 값보다 작습니다.
  71. [page:OrthographicCamera]와 달리, PerspectiveCamera의 근평면 값으로 *0*은 유요한 값이 <em>아님</em>을 주의해주세요
  72. </p>
  73. <h3>[property:Object view]</h3>
  74. <p>
  75. 절두체 윈도우 상세 혹은 null값입니다.
  76. [page:PerspectiveCamera.setViewOffset .setViewOffset] 메서드로 설정하고 [page:PerspectiveCamera.clearViewOffset .clearViewOffset]로 제거됩니다.
  77. </p>
  78. <h3>[property:number zoom]</h3>
  79. <p>카메라의 확대 요소를 가져오거나 설정합니다. 기본값은 *1*입니다.</p>
  80. <h2>메서드</h2>
  81. <p>일반 메서드는 기본 [page:Camera] 클래스를 참고하세요.</p>
  82. <h3>[method:undefined clearViewOffset]()</h3>
  83. <p>[page:PerspectiveCamera.setViewOffset .setViewOffset] 메서드로 설정된 오프셋을 모두 제거합니다.</p>
  84. <h3>[method:Float getEffectiveFOV]()</h3>
  85. <p>.zoom을 고려한 현재의 수직 시야각을 도 단위로 리턴합니다.</p>
  86. <h3>[method:Float getFilmHeight]()</h3>
  87. <p>
  88. 필름에 있는 이미지의 높이를 리턴합니다.
  89. .aspect가 1보다 작거나 같으면(portraot 포맷) 결과는 .filmGauge와 동일합니다.
  90. </p>
  91. <h3>[method:Float getFilmWidth]()</h3>
  92. <p>
  93. 필름에 있는 이미지의 너비를 리턴합니다.
  94. .aspect가 1보다 크거나 같으면(landscape 포맷) 결과는 .filmGauge와 동일합니다.
  95. </p>
  96. <h3>[method:Float getFocalLength]()</h3>
  97. <p>.filmGauge에 대해 현재 .fov의 초점 길이를 리턴합니다.</p>
  98. <h3>[method:undefined setFocalLength]( [param:Float focalLength] )</h3>
  99. <p>
  100. 현재 [page:PerspectiveCamera.filmGauge .filmGauge]에 대해 초점 길이로 FOV를 설정합니다.<br /><br />
  101. 기본적으로 초점 길이는 35mm(전체 프레임) 카메라로 지정됩니다.
  102. </p>
  103. <h3>[method:undefined setViewOffset]( [param:Float fullWidth], [param:Float fullHeight], [param:Float x], [param:Float y], [param:Float width], [param:Float height] )</h3>
  104. <p>
  105. fullWidth — 멀티뷰 설정의 최대너비<br />
  106. fullHeight — 멀티뷰 설정의 최대높이<br />
  107. x — 서브 카메라의 수평 오프셋<br />
  108. y — 서브 카메라의 수직 오프셋<br />
  109. width — 서브 카메라의 너비<br />
  110. height — 서브 카메라의 높이
  111. </p>
  112. <p>
  113. 큰 절두체의 오프셋을 설정합니다. 멀티윈도우 혹은 멀티모니터/멀티 머신 설정에 유용합니다.
  114. </p>
  115. <p>
  116. 예를 들어, 3x2 모니터를 가지고 있고 각 모니터가 1920x1080이면 아래 그림처럼 될 것입니다.<br />
  117. <pre>
  118. +---+---+---+
  119. | A | B | C |
  120. +---+---+---+
  121. | D | E | F |
  122. +---+---+---+
  123. </pre>
  124. 각 모니터에 대해 아래처럼 호출할 수 있을 것입니다:<br />
  125. <code>const w = 1920;
  126. const h = 1080;
  127. const fullWidth = w * 3;
  128. const fullHeight = h * 2;
  129. // A
  130. camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );
  131. // B
  132. camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );
  133. // C
  134. camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );
  135. // D
  136. camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );
  137. // E
  138. camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );
  139. // F
  140. camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
  141. </code>
  142. 모니터들이 반드시 같은 크기나 구조여야 할 필요가 없다는 점을 참고하세요.
  143. </p>
  144. <h3>[method:undefined updateProjectionMatrix]()</h3>
  145. <p>
  146. 카메라 투영 매트릭스를 업데이트합니다. 파라미터 변경 후에 반드시 호출해야합니다.
  147. </p>
  148. <h3>[method:Object toJSON]([param:Object meta])</h3>
  149. <p>
  150. meta -- 객체의 자식들의 이미지와 텍스쳐같은 메타데이터를 담고 있는 객체입니다.<br />
  151. 카메라를 three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format]으로 변환합니다.
  152. </p>
  153. <h2>소스 코드</h2>
  154. <p>
  155. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  156. </p>
  157. </body>
  158. </html>