TileCreasedNormalsPlugin.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>TileCreasedNormalsPlugin - 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">TileCreasedNormalsPlugin</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>A plugin for <code>3d-tiles-renderer</code> that computes creased vertex normals for the
  16. geometry of each loaded tile: smooth normals everywhere except where faces meet
  17. at an angle greater than the crease angle. Useful for photogrammetry tile sets
  18. like Google Photorealistic 3D Tiles which come without vertex normals.</p>
  19. <p>The normals are computed in a Web Worker so tile processing doesn't block the
  20. main thread. Tiles are displayed once their normals are ready.</p></div>
  21. <h2>Code Example</h2>
  22. <div translate="no"><pre><code class="language-js">tiles.registerPlugin( new TileCreasedNormalsPlugin( { creaseAngle: Math.PI / 6 } ) );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <h2 class="subsection-title">Import</h2>
  27. <p><span translate="no">TileCreasedNormalsPlugin</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>
  28. <pre><code class="language-js">import { TileCreasedNormalsPlugin } from 'three/addons/misc/TileCreasedNormalsPlugin.js';</code></pre>
  29. <div class="container-overview">
  30. <h2>Constructor</h2>
  31. <h3 class="name name-method" id="TileCreasedNormalsPlugin" translate="no">new <a href="#TileCreasedNormalsPlugin">TileCreasedNormalsPlugin</a><span class="signature">( options : <span class="param-type">Object</span> )</span> </h3>
  32. <div class="method">
  33. <div class="description">
  34. <p>Constructs a new plugin.</p>
  35. </div>
  36. <table class="params">
  37. <tbody>
  38. <tr>
  39. <td class="name">
  40. <strong translate="no">options</strong>
  41. </td>
  42. <td class="description last">
  43. <p>The configuration options.</p>
  44. <table class="params">
  45. <tbody>
  46. <tr>
  47. <td class="name">
  48. <strong translate="no">creaseAngle</strong>
  49. </td>
  50. <td class="description last">
  51. <p>The crease angle in radians.</p>
  52. <p>Default is <code>Math.PI/3</code>.</p>
  53. </td>
  54. </tr>
  55. </tbody>
  56. </table>
  57. </td>
  58. </tr>
  59. </tbody>
  60. </table>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Properties</h2>
  64. <div class="member">
  65. <h3 class="name" id="creaseAngle" translate="no">.<a href="#creaseAngle">creaseAngle</a><span class="type-signature"> : number</span> </h3>
  66. <div class="description">
  67. <p>The crease angle in radians.</p>
  68. </div>
  69. </div>
  70. <h2 class="subsection-title">Methods</h2>
  71. <h3 class="name name-method" id="dispose" translate="no">.<a href="#dispose">dispose</a><span class="signature">()</span> </h3>
  72. <div class="method">
  73. <div class="description">
  74. <p>Called by the tiles renderer when the plugin is unregistered or the
  75. tiles renderer is disposed.</p>
  76. </div>
  77. </div>
  78. <h3 class="name name-method" id="processTileModel" translate="no">.<a href="#processTileModel">processTileModel</a><span class="signature">( scene : <span class="param-type"><a href="Object3D.html">Object3D</a></span> )</span><span class="type-signature"> : Promise</span> </h3>
  79. <div class="method">
  80. <div class="description">
  81. <p>Called by the tiles renderer for each loaded tile model. The tile is
  82. displayed once the returned promise resolves.</p>
  83. </div>
  84. <table class="params">
  85. <tbody>
  86. <tr>
  87. <td class="name">
  88. <strong translate="no">scene</strong>
  89. </td>
  90. <td class="description last">
  91. <p>The tile model.</p>
  92. </td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. <dl class="details">
  97. <dt class="tag-returns"><strong>Returns:</strong> A promise that resolves when all geometries have creased normals.</dt>
  98. </dl>
  99. </div>
  100. <h2 class="subsection-title">Source</h2>
  101. <p>
  102. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/misc/TileCreasedNormalsPlugin.js" translate="no" target="_blank" rel="noopener">examples/jsm/misc/TileCreasedNormalsPlugin.js</a>
  103. </p>
  104. </article>
  105. </section>
  106. <script src="../scripts/linenumber.js"></script>
  107. <script src="../scripts/page.js"></script>
  108. </body>
  109. </html>
粤ICP备19079148号