VertexTangentsHelper.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>VertexTangentsHelper - 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="Line.html">Line</a> → <a href="LineSegments.html">LineSegments</a> → </p>
  13. <h1 translate="no">VertexTangentsHelper</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Visualizes an object's vertex tangents.</p>
  17. <p>Requires that tangents have been specified in the geometry as a buffer attribute or
  18. have been calculated using <a href="BufferGeometry.html#computeTangents">BufferGeometry#computeTangents</a>.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const helper = new VertexTangentsHelper( mesh, 1, 0xff0000 );
  21. scene.add( helper );
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <h2 class="subsection-title">Import</h2>
  26. <p><span translate="no">VertexTangentsHelper</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>
  27. <pre><code class="language-js">import { VertexTangentsHelper } from 'three/addons/helpers/VertexTangentsHelper.js';</code></pre>
  28. <div class="container-overview">
  29. <h2>Constructor</h2>
  30. <h3 class="name name-method" id="VertexTangentsHelper" translate="no">new <a href="#VertexTangentsHelper">VertexTangentsHelper</a><span class="signature">( object : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, size : <span class="param-type">number</span>, color : <span class="param-type">number | <a href="Color.html">Color</a> | string</span> )</span> </h3>
  31. <div class="method">
  32. <div class="description">
  33. <p>Constructs a new vertex tangents helper.</p>
  34. </div>
  35. <table class="params">
  36. <tbody>
  37. <tr>
  38. <td class="name">
  39. <strong>object</strong>
  40. </td>
  41. <td class="description last">
  42. <p>The object for which to visualize vertex tangents.</p>
  43. </td>
  44. </tr>
  45. <tr>
  46. <td class="name">
  47. <strong>size</strong>
  48. </td>
  49. <td class="description last">
  50. <p>The helper's size.</p>
  51. <p>Default is <code>1</code>.</p>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class="name">
  56. <strong>color</strong>
  57. </td>
  58. <td class="description last">
  59. <p>The helper's color.</p>
  60. <p>Default is <code>0xff0000</code>.</p>
  61. </td>
  62. </tr>
  63. </tbody>
  64. </table>
  65. </div>
  66. </div>
  67. <h2 class="subsection-title">Properties</h2>
  68. <div class="member">
  69. <h3 class="name" id="matrixAutoUpdate" translate="no">.<a href="#matrixAutoUpdate">matrixAutoUpdate</a><span class="type-signature"> : boolean</span> </h3>
  70. <div class="description">
  71. <p>Overwritten and set to <code>false</code> since the object's world transformation
  72. is encoded in the helper's geometry data.</p>
  73. <p>Default is <code>false</code>.</p>
  74. </div>
  75. <dl class="details">
  76. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="LineSegments.html#matrixAutoUpdate">LineSegments#matrixAutoUpdate</a></dt>
  77. </dl>
  78. </div>
  79. <div class="member">
  80. <h3 class="name" id="object" translate="no">.<a href="#object">object</a><span class="type-signature"> : <a href="Object3D.html">Object3D</a></span> </h3>
  81. <div class="description">
  82. <p>The object for which to visualize vertex tangents.</p>
  83. </div>
  84. </div>
  85. <div class="member">
  86. <h3 class="name" id="size" translate="no">.<a href="#size">size</a><span class="type-signature"> : number</span> </h3>
  87. <div class="description">
  88. <p>The helper's size.</p>
  89. <p>Default is <code>1</code>.</p>
  90. </div>
  91. </div>
  92. <h2 class="subsection-title">Methods</h2>
  93. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  94. <div class="method">
  95. <div class="description">
  96. <p>Frees the GPU-related resources allocated by this instance. Call this
  97. method whenever this instance is no longer used in your app.</p>
  98. </div>
  99. </div>
  100. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  101. <div class="method">
  102. <div class="description">
  103. <p>Updates the vertex normals preview based on the object's world transform.</p>
  104. </div>
  105. </div>
  106. <h2 class="subsection-title">Source</h2>
  107. <p>
  108. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/helpers/VertexTangentsHelper.js" translate="no" target="_blank" rel="noopener">examples/jsm/helpers/VertexTangentsHelper.js</a>
  109. </p>
  110. </article>
  111. </section>
  112. <script src="../scripts/linenumber.js"></script>
  113. <script src="../scripts/page.js"></script>
  114. </body>
  115. </html>
粤ICP备19079148号