SimplifyModifier.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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/">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">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">BufferGeometry</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"><code>geometry</code></td>
  45. <td class="description last"><p>The geometry to modify.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>count</code></td>
  49. <td class="description last"><p>The number of vertices to remove.</p></td>
  50. </tr>
  51. </tbody>
  52. </table>
  53. <dl class="details">
  54. <dt class="tag-returns"><strong>Returns:</strong> A new, modified geometry.</dt>
  55. </dl>
  56. </div>
  57. <h2 class="subsection-title">Source</h2>
  58. <p>
  59. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/modifiers/SimplifyModifier.js" target="_blank" rel="noopener" translate="no">examples/jsm/modifiers/SimplifyModifier.js</a>
  60. </p>
  61. </article>
  62. </section>
  63. <script src="../scripts/linenumber.js"></script>
  64. <script src="../scripts/page.js"></script>
  65. </body>
  66. </html>
粤ICP备19079148号