TextureHelper.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>TextureHelper - 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="Object3D.html">Object3D</a> → <a href="Mesh.html">Mesh</a> → </p>
  13. <h1 translate="no">TextureHelper</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A helper that can be used to display any type of texture for
  17. debugging purposes. Depending on the type of texture (2D, 3D, Array),
  18. the helper becomes a plane or box mesh.</p>
  19. <p>This helper can only be used with <a href="WebGLRenderer.html">WebGLRenderer</a>.
  20. When using <a href="WebGPURenderer.html">WebGPURenderer</a>, import from <code>TextureHelperGPU.js</code>.</p></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">TextureHelper</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 { TextureHelper } from 'three/addons/helpers/TextureHelper.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="TextureHelper" translate="no">new <a href="#TextureHelper">TextureHelper</a><span class="signature">( texture : <span class="param-type"><a href="Texture.html">Texture</a></span>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span>, depth : <span class="param-type">number</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new texture helper.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>texture</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The texture to visualize.</p>
  41. </td>
  42. </tr>
  43. <tr>
  44. <td class="name">
  45. <strong>width</strong>
  46. </td>
  47. <td class="description last">
  48. <p>The helper's width.</p>
  49. <p>Default is <code>1</code>.</p>
  50. </td>
  51. </tr>
  52. <tr>
  53. <td class="name">
  54. <strong>height</strong>
  55. </td>
  56. <td class="description last">
  57. <p>The helper's height.</p>
  58. <p>Default is <code>1</code>.</p>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td class="name">
  63. <strong>depth</strong>
  64. </td>
  65. <td class="description last">
  66. <p>The helper's depth.</p>
  67. <p>Default is <code>1</code>.</p>
  68. </td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. </div>
  73. </div>
  74. <h2 class="subsection-title">Properties</h2>
  75. <div class="member">
  76. <h3 class="name" id="texture" translate="no">.<a href="#texture">texture</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  77. <div class="description">
  78. <p>The texture to visualize.</p>
  79. </div>
  80. </div>
  81. <h2 class="subsection-title">Methods</h2>
  82. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  83. <div class="method">
  84. <div class="description">
  85. <p>Frees the GPU-related resources allocated by this instance. Call this
  86. method whenever this instance is no longer used in your app.</p>
  87. </div>
  88. </div>
  89. <h2 class="subsection-title">Source</h2>
  90. <p>
  91. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/helpers/TextureHelper.js" translate="no" target="_blank" rel="noopener">examples/jsm/helpers/TextureHelper.js</a>
  92. </p>
  93. </article>
  94. </section>
  95. <script src="../scripts/linenumber.js"></script>
  96. <script src="../scripts/page.js"></script>
  97. </body>
  98. </html>
粤ICP备19079148号