CityGenerator.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CityGenerator - 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">CityGenerator</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>Lays out a grid of city blocks and fills each lot with a <a href="SkyscraperGenerator.html">SkyscraperGenerator</a>
  16. tower of its own seed, height and footprint, optionally on raised sidewalk
  17. slabs (curbs). Returns a <code>THREE.Group</code> ready to add to a scene.</p>
  18. <p>Pass a building material to dress the towers; the sidewalks dress themselves
  19. via <a href="SidewalkGenerator.html">SidewalkGenerator</a>. The layout is exposed as
  20. CityGenerator#layout so the surrounding scene (road markings, etc.)
  21. can align to the same grid.</p></div>
  22. <h2>Code Example</h2>
  23. <div translate="no"><pre><code class="language-js">const city = new CityGenerator( { seed: 1 } );
  24. scene.add( city.build( materials ) );
  25. </code></pre></div>
  26. </header>
  27. <article>
  28. <div class="container-overview">
  29. <h2>Constructor</h2>
  30. <h3 class="name name-method" id="CityGenerator" translate="no">new <a href="#CityGenerator">CityGenerator</a><span class="signature">()</span> </h3>
  31. <div class="method">
  32. </div>
  33. </div>
  34. <h2 class="subsection-title">Source</h2>
  35. <p>
  36. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/generators/CityGenerator.js" translate="no" target="_blank" rel="noopener">examples/jsm/generators/CityGenerator.js</a>
  37. </p>
  38. </article>
  39. </section>
  40. <script src="../scripts/linenumber.js"></script>
  41. <script src="../scripts/page.js"></script>
  42. </body>
  43. </html>
粤ICP备19079148号