module-GeometryCompressionUtils.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>GeometryCompressionUtils - 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">GeometryCompressionUtils</h1>
  13. <section>
  14. <header>
  15. </header>
  16. <article>
  17. <h2 class="subsection-title">Import</h2>
  18. <p><span translate="no">GeometryCompressionUtils</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  19. <pre><code class="language-js">import * as GeometryCompressionUtils from 'three/addons/utils/GeometryCompressionUtils.js';</code></pre>
  20. <div class="container-overview">
  21. </div>
  22. <h2 class="subsection-title">Methods</h2>
  23. <h3 class="name name-method" id="~compressNormals" translate="no">.<a href="#~compressNormals">compressNormals</a><span class="signature">( geometry : <span class="param-type">BufferGeometry</span>, encodeMethod : <span class="param-type">'DEFAULT' | 'OCT1Byte' | 'OCT2Byte' | 'ANGLES'</span> )</span> <span class="type-signature">(inner) </span></h3>
  24. <div class="method">
  25. <div class="description">
  26. <p>Compressed the given geometry's <code>normal</code> attribute by the selected encode method.</p>
  27. </div>
  28. <table class="params">
  29. <tbody>
  30. <tr>
  31. <td class="name"><code>geometry</code></td>
  32. <td class="description last"><p>The geometry whose normals should be compressed.</p></td>
  33. </tr>
  34. <tr>
  35. <td class="name"><code>encodeMethod</code></td>
  36. <td class="description last"><p>The compression method.</p></td>
  37. </tr>
  38. </tbody>
  39. </table>
  40. </div>
  41. <h3 class="name name-method" id="~compressPositions" translate="no">.<a href="#~compressPositions">compressPositions</a><span class="signature">( geometry : <span class="param-type">BufferGeometry</span> )</span> <span class="type-signature">(inner) </span></h3>
  42. <div class="method">
  43. <div class="description">
  44. <p>Compressed the given geometry's <code>position</code> attribute.</p>
  45. </div>
  46. <table class="params">
  47. <tbody>
  48. <tr>
  49. <td class="name"><code>geometry</code></td>
  50. <td class="description last"><p>The geometry whose position values should be compressed.</p></td>
  51. </tr>
  52. </tbody>
  53. </table>
  54. </div>
  55. <h3 class="name name-method" id="~compressUvs" translate="no">.<a href="#~compressUvs">compressUvs</a><span class="signature">( geometry : <span class="param-type">BufferGeometry</span> )</span> <span class="type-signature">(inner) </span></h3>
  56. <div class="method">
  57. <div class="description">
  58. <p>Compressed the given geometry's <code>uv</code> attribute.</p>
  59. </div>
  60. <table class="params">
  61. <tbody>
  62. <tr>
  63. <td class="name"><code>geometry</code></td>
  64. <td class="description last"><p>The geometry whose texture coordinates should be compressed.</p></td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. </div>
  69. <h2 class="subsection-title">Source</h2>
  70. <p>
  71. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/GeometryCompressionUtils.js" target="_blank" rel="noopener" translate="no">examples/jsm/utils/GeometryCompressionUtils.js</a>
  72. </p>
  73. </article>
  74. </section>
  75. <script src="../scripts/linenumber.js"></script>
  76. <script src="../scripts/page.js"></script>
  77. </body>
  78. </html>
粤ICP备19079148号