ParallaxBarrierEffect.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ParallaxBarrierEffect - 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">ParallaxBarrierEffect</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A class that creates an parallax barrier 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="ParallaxBarrierPassNode.html">ParallaxBarrierPassNode</a>.</p></div>
  18. </header>
  19. <article>
  20. <h2 class="subsection-title">Import</h2>
  21. <p><span translate="no">ParallaxBarrierEffect</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  22. <pre><code class="language-js">import { ParallaxBarrierEffect } from 'three/addons/effects/ParallaxBarrierEffect.js';</code></pre>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="ParallaxBarrierEffect" translate="no">new <a href="#ParallaxBarrierEffect">ParallaxBarrierEffect</a><span class="signature">( renderer : <span class="param-type">WebGLRenderer</span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new parallax barrier effect.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name"><code>renderer</code></td>
  34. <td class="description last"><p>The renderer.</p></td>
  35. </tr>
  36. </tbody>
  37. </table>
  38. </div>
  39. </div>
  40. <h2 class="subsection-title">Methods</h2>
  41. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  42. <div class="method">
  43. <div class="description">
  44. <p>Frees internal resources. This method should be called
  45. when the effect is no longer required.</p>
  46. </div>
  47. </div>
  48. <h3 class="name name-method" id="render" translate="no">.<a href="#render">render</a><span class="signature">( scene : <span class="param-type">Object3D</span>, camera : <span class="param-type">Camera</span> )</span> </h3>
  49. <div class="method">
  50. <div class="description">
  51. <p>When using this effect, this method should be called instead of the
  52. default <a href="WebGLRenderer.html#render">WebGLRenderer#render</a>.</p>
  53. </div>
  54. <table class="params">
  55. <tbody>
  56. <tr>
  57. <td class="name"><code>scene</code></td>
  58. <td class="description last"><p>The scene to render.</p></td>
  59. </tr>
  60. <tr>
  61. <td class="name"><code>camera</code></td>
  62. <td class="description last"><p>The camera.</p></td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. </div>
  67. <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>
  68. <div class="method">
  69. <div class="description">
  70. <p>Resizes the effect.</p>
  71. </div>
  72. <table class="params">
  73. <tbody>
  74. <tr>
  75. <td class="name"><code>width</code></td>
  76. <td class="description last"><p>The width of the effect in logical pixels.</p></td>
  77. </tr>
  78. <tr>
  79. <td class="name"><code>height</code></td>
  80. <td class="description last"><p>The height of the effect in logical pixels.</p></td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. </div>
  85. <h2 class="subsection-title">Source</h2>
  86. <p>
  87. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/effects/ParallaxBarrierEffect.js" target="_blank" rel="noopener" translate="no">examples/jsm/effects/ParallaxBarrierEffect.js</a>
  88. </p>
  89. </article>
  90. </section>
  91. <script src="../scripts/linenumber.js"></script>
  92. <script src="../scripts/page.js"></script>
  93. </body>
  94. </html>
粤ICP备19079148号