AnaglyphEffect.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>AnaglyphEffect - 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. <h1 translate="no">AnaglyphEffect</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A class that creates an anaglyph effect.</p>
  16. <p>Note that this class can only be used with <a href="WebGLRenderer.html">WebGLRenderer</a>.
  17. When using <a href="WebGPURenderer.html">WebGPURenderer</a>, use <a href="AnaglyphPassNode.html">AnaglyphPassNode</a>.</p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <p><span translate="no">AnaglyphEffect</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>
  22. <pre><code class="language-js">import { AnaglyphEffect } from 'three/addons/effects/AnaglyphEffect.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="AnaglyphEffect" translate="no">new <a href="#AnaglyphEffect">AnaglyphEffect</a><span class="signature">( renderer : <span class="param-type"><a href="WebGLRenderer.html">WebGLRenderer</a></span>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new anaglyph effect.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>renderer</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The renderer.</p>
  38. </td>
  39. </tr>
  40. <tr>
  41. <td class="name">
  42. <strong>width</strong>
  43. </td>
  44. <td class="description last">
  45. <p>The width of the effect in physical pixels.</p>
  46. <p>Default is <code>512</code>.</p>
  47. </td>
  48. </tr>
  49. <tr>
  50. <td class="name">
  51. <strong>height</strong>
  52. </td>
  53. <td class="description last">
  54. <p>The height of the effect in physical pixels.</p>
  55. <p>Default is <code>512</code>.</p>
  56. </td>
  57. </tr>
  58. </tbody>
  59. </table>
  60. </div>
  61. </div>
  62. <h2 class="subsection-title">Methods</h2>
  63. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  64. <div class="method">
  65. <div class="description">
  66. <p>Frees internal resources. This method should be called
  67. when the effect is no longer required.</p>
  68. </div>
  69. </div>
  70. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( scene : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, camera : <span class="param-type"><a href="Camera.html">Camera</a></span> )</span> </h3>
  71. <div class="method">
  72. <div class="description">
  73. <p>When using this effect, this method should be called instead of the
  74. default <a href="WebGLRenderer.html#render">WebGLRenderer#render</a>.</p>
  75. </div>
  76. <table class="params">
  77. <tbody>
  78. <tr>
  79. <td class="name">
  80. <strong>scene</strong>
  81. </td>
  82. <td class="description last">
  83. <p>The scene to render.</p>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td class="name">
  88. <strong>camera</strong>
  89. </td>
  90. <td class="description last">
  91. <p>The camera.</p>
  92. </td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. </div>
  97. <h3 class="name name-method" id="setSize" translate="no">.<a href="#setSize">setSize</a><span class="signature">( width : <span class="param-type">number</span>, height : <span class="param-type">number</span> )</span> </h3>
  98. <div class="method">
  99. <div class="description">
  100. <p>Resizes the effect.</p>
  101. </div>
  102. <table class="params">
  103. <tbody>
  104. <tr>
  105. <td class="name">
  106. <strong>width</strong>
  107. </td>
  108. <td class="description last">
  109. <p>The width of the effect in logical pixels.</p>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td class="name">
  114. <strong>height</strong>
  115. </td>
  116. <td class="description last">
  117. <p>The height of the effect in logical pixels.</p>
  118. </td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. </div>
  123. <h2 class="subsection-title">Source</h2>
  124. <p>
  125. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/effects/AnaglyphEffect.js" translate="no" target="_blank" rel="noopener">examples/jsm/effects/AnaglyphEffect.js</a>
  126. </p>
  127. </article>
  128. </section>
  129. <script src="../scripts/linenumber.js"></script>
  130. <script src="../scripts/page.js"></script>
  131. </body>
  132. </html>
粤ICP备19079148号