AnaglyphPassNode.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>AnaglyphPassNode - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Node.html">Node</a> → <a href="TempNode.html">TempNode</a> → <a href="PassNode.html">PassNode</a> → <a href="StereoCompositePassNode.html">StereoCompositePassNode</a> → </p>
  13. <h1 translate="no">AnaglyphPassNode</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A render pass node that creates an anaglyph effect using physically-correct
  17. off-axis stereo projection.</p>
  18. <p>This implementation uses CameraUtils.frameCorners() to align stereo
  19. camera frustums to a virtual screen plane, providing accurate depth
  20. perception with zero parallax at the plane distance.</p></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">AnaglyphPassNode</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  25. <pre><code class="language-js">import { anaglyphPass, AnaglyphAlgorithm, AnaglyphColorMode } from 'three/addons/tsl/display/AnaglyphPassNode.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="AnaglyphPassNode" translate="no">new <a href="#AnaglyphPassNode">AnaglyphPassNode</a><span class="signature">( scene : <span class="param-type"><a href="Scene.html">Scene</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new anaglyph pass node.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong translate="no">scene</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The scene to render.</p>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="name">
  45. <strong translate="no">camera</strong>
  46. </td>
  47. <td class="description last">
  48. <p>The camera to render the scene with.</p>
  49. </td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. </div>
  54. </div>
  55. <h2 class="subsection-title">Properties</h2>
  56. <div class="member">
  57. <h3 class="name" id="algorithm" translate="no">.<a href="#algorithm">algorithm</a><span class="type-signature"> : string</span> </h3>
  58. <div class="description">
  59. <p>Gets the current anaglyph algorithm.</p>
  60. </div>
  61. </div>
  62. <div class="member">
  63. <h3 class="name" id="algorithm" translate="no">.<a href="#algorithm">algorithm</a><span class="type-signature"> : string</span> </h3>
  64. <div class="description">
  65. <p>Sets the anaglyph algorithm.</p>
  66. </div>
  67. </div>
  68. <div class="member">
  69. <h3 class="name" id="colorMode" translate="no">.<a href="#colorMode">colorMode</a><span class="type-signature"> : string</span> </h3>
  70. <div class="description">
  71. <p>Gets the current color mode.</p>
  72. </div>
  73. </div>
  74. <div class="member">
  75. <h3 class="name" id="colorMode" translate="no">.<a href="#colorMode">colorMode</a><span class="type-signature"> : string</span> </h3>
  76. <div class="description">
  77. <p>Sets the color mode.</p>
  78. </div>
  79. </div>
  80. <div class="member">
  81. <h3 class="name" id="eyeSep" translate="no">.<a href="#eyeSep">eyeSep</a><span class="type-signature"> : number</span> </h3>
  82. <div class="description">
  83. <p>The interpupillary distance (eye separation) in world units.
  84. Typical human IPD is 0.064 meters (64mm).</p>
  85. <p>Default is <code>0.064</code>.</p>
  86. </div>
  87. </div>
  88. <div class="member">
  89. <h3 class="name" id="isAnaglyphPassNode" translate="no">.<a href="#isAnaglyphPassNode">isAnaglyphPassNode</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  90. <div class="description">
  91. <p>This flag can be used for type testing.</p>
  92. <p>Default is <code>true</code>.</p>
  93. </div>
  94. </div>
  95. <div class="member">
  96. <h3 class="name" id="planeDistance" translate="no">.<a href="#planeDistance">planeDistance</a><span class="type-signature"> : number</span> </h3>
  97. <div class="description">
  98. <p>The distance in world units from the viewer to the virtual
  99. screen plane where zero parallax (screen depth) occurs.
  100. Objects at this distance appear at the screen surface.
  101. Objects closer appear in front of the screen (negative parallax).
  102. Objects further appear behind the screen (positive parallax).</p>
  103. <p>The screen dimensions are derived from the camera's FOV and aspect ratio
  104. at this distance, ensuring the stereo view matches the camera's field of view.</p>
  105. <p>Default is <code>0.5</code>.</p>
  106. </div>
  107. </div>
  108. <h2 class="subsection-title">Methods</h2>
  109. <h3 class="name name-method" id="setup" translate="no">.<a href="#setup">setup</a><span class="signature">( builder : <span class="param-type"><a href="NodeBuilder.html">NodeBuilder</a></span> )</span><span class="type-signature"> : <a href="PassTextureNode.html">PassTextureNode</a></span> </h3>
  110. <div class="method">
  111. <div class="description">
  112. <p>This method is used to setup the effect's TSL code.</p>
  113. </div>
  114. <table class="params">
  115. <tbody>
  116. <tr>
  117. <td class="name">
  118. <strong translate="no">builder</strong>
  119. </td>
  120. <td class="description last">
  121. <p>The current node builder.</p>
  122. </td>
  123. </tr>
  124. </tbody>
  125. </table>
  126. <dl class="details">
  127. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="StereoCompositePassNode.html#setup">StereoCompositePassNode#setup</a></dt>
  128. </dl>
  129. </div>
  130. <h3 class="name name-method" id="updateStereoCamera" translate="no">.<a href="#updateStereoCamera">updateStereoCamera</a><span class="signature">( coordinateSystem : <span class="param-type">number</span> )</span> </h3>
  131. <div class="method">
  132. <div class="description">
  133. <p>Updates the internal stereo camera using frameCorners for
  134. physically-correct off-axis projection.</p>
  135. </div>
  136. <table class="params">
  137. <tbody>
  138. <tr>
  139. <td class="name">
  140. <strong translate="no">coordinateSystem</strong>
  141. </td>
  142. <td class="description last">
  143. <p>The current coordinate system.</p>
  144. </td>
  145. </tr>
  146. </tbody>
  147. </table>
  148. <dl class="details">
  149. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="StereoCompositePassNode.html#updateStereoCamera">StereoCompositePassNode#updateStereoCamera</a></dt>
  150. </dl>
  151. </div>
  152. <h2 class="subsection-title">Source</h2>
  153. <p>
  154. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/tsl/display/AnaglyphPassNode.js" translate="no" target="_blank" rel="noopener">examples/jsm/tsl/display/AnaglyphPassNode.js</a>
  155. </p>
  156. </article>
  157. </section>
  158. <script src="../scripts/linenumber.js"></script>
  159. <script src="../scripts/page.js"></script>
  160. </body>
  161. </html>
粤ICP备19079148号