1
0

SimplifyModifier.html 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SimplifyModifier - 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">SimplifyModifier</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>This class can be used to modify a geometry by simplifying it. A typical use
  16. case for such a modifier is automatic LOD generation.</p>
  17. <p>The implementation is based on <a href="https://web.archive.org/web/20230610044040/http://www.melax.com/polychop/" target="_blank" rel="noopener">Progressive Mesh type Polygon Reduction Algorithm</a>
  18. by Stan Melax in 1998.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const modifier = new SimplifyModifier();
  21. geometry = modifier.modify( geometry );
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <h2 class="subsection-title">Import</h2>
  26. <p><span translate="no">SimplifyModifier</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 { SimplifyModifier } from 'three/addons/modifiers/SimplifyModifier.js';</code></pre>
  28. <div class="container-overview">
  29. <h2>Constructor</h2>
  30. <h3 class="name name-method" id="SimplifyModifier" translate="no">new <a href="#SimplifyModifier">SimplifyModifier</a><span class="signature">()</span> </h3>
  31. <div class="method">
  32. </div>
  33. </div>
  34. <h2 class="subsection-title">Methods</h2>
  35. <h3 class="name name-method" id="modify" translate="no">.<a href="#modify">modify</a><span class="signature">( geometry : <span class="param-type"><a href="BufferGeometry.html">BufferGeometry</a></span>, count : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="BufferGeometry.html">BufferGeometry</a></span> </h3>
  36. <div class="method">
  37. <div class="description">
  38. <p>Returns a new, modified version of the given geometry by applying a simplification.
  39. Please note that the resulting geometry is always non-indexed.</p>
  40. </div>
  41. <table class="params">
  42. <tbody>
  43. <tr>
  44. <td class="name">
  45. <strong>geometry</strong>
  46. </td>
  47. <td class="description last">
  48. <p>The geometry to modify.</p>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td class="name">
  53. <strong>count</strong>
  54. </td>
  55. <td class="description last">
  56. <p>The number of vertices to remove.</p>
  57. </td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. <dl class="details">
  62. <dt class="tag-returns"><strong>Returns:</strong> A new, modified geometry.</dt>
  63. </dl>
  64. </div>
  65. <h2 class="subsection-title">Source</h2>
  66. <p>
  67. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/modifiers/SimplifyModifier.js" translate="no" target="_blank" rel="noopener">examples/jsm/modifiers/SimplifyModifier.js</a>
  68. </p>
  69. </article>
  70. </section>
  71. <script src="../scripts/linenumber.js"></script>
  72. <script src="../scripts/page.js"></script>
  73. </body>
  74. </html>
粤ICP备19079148号