TextureHelper.html 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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">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">Texture</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"><code>texture</code></td>
  37. <td class="description last"><p>The texture to visualize.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>width</code></td>
  41. <td class="description last"><p>The helper's width.<br/>Default is <code>1</code>.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>height</code></td>
  45. <td class="description last"><p>The helper's height.<br/>Default is <code>1</code>.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>depth</code></td>
  49. <td class="description last"><p>The helper's depth.<br/>Default is <code>1</code>.</p></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="texture" translate="no">.<a href="#texture">texture</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
  58. <div class="description">
  59. <p>The texture to visualize.</p>
  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 the GPU-related resources allocated by this instance. Call this
  67. method whenever this instance is no longer used in your app.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Source</h2>
  71. <p>
  72. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/helpers/TextureHelper.js" target="_blank" rel="noopener" translate="no">examples/jsm/helpers/TextureHelper.js</a>
  73. </p>
  74. </article>
  75. </section>
  76. <script src="../scripts/linenumber.js"></script>
  77. <script src="../scripts/page.js"></script>
  78. </body>
  79. </html>
粤ICP备19079148号