SkyscraperGenerator.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>SkyscraperGenerator - 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">SkyscraperGenerator</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Generates intricate, tripartite &quot;Beaux-Arts / Neo-Gothic&quot; terracotta
  16. skyscrapers from a small set of parameters.</p>
  17. <p>The mass is read as a footprint polygon (a rectangle with one chamfered
  18. corner) split into vertical faces, each split into three tiers — a tall
  19. arcaded base, a repeating shaft and an ornate crown — then into floors and
  20. bays. A handful of authored pieces (a pier, a window, a cornice profile, a
  21. gothic arch) are instanced across the whole tower, then baked — together with
  22. the bespoke base arcade — into a single non-indexed BufferGeometry tagged with
  23. a per-vertex <code>partId</code> (PartId) so one material can shade every zone.</p>
  24. <p>The generator is material agnostic — it only produces geometry. Pass a single
  25. material (e.g. a TSL node material that branches on <code>partId</code>) to dress it.</p></div>
  26. <h2>Code Example</h2>
  27. <div translate="no"><pre><code class="language-js">const generator = new SkyscraperGenerator( { seed: 35, totalHeight: 140 }, material );
  28. scene.add( generator.build() ); // a single Mesh
  29. </code></pre></div>
  30. </header>
  31. <article>
  32. <div class="container-overview">
  33. <h2>Constructor</h2>
  34. <h3 class="name name-method" id="SkyscraperGenerator" translate="no">new <a href="#SkyscraperGenerator">SkyscraperGenerator</a><span class="signature">()</span> </h3>
  35. <div class="method">
  36. </div>
  37. </div>
  38. <h2 class="subsection-title">Source</h2>
  39. <p>
  40. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/city/SkyscraperGenerator.js" translate="no" target="_blank" rel="noopener">examples/jsm/generators/city/SkyscraperGenerator.js</a>
  41. </p>
  42. </article>
  43. </section>
  44. <script src="../scripts/linenumber.js"></script>
  45. <script src="../scripts/page.js"></script>
  46. </body>
  47. </html>
粤ICP备19079148号