Capítulo 524 de 859

Chapter 524: CityGenerator

Core Idea

Lays out a grid of city blocks and fills each lot with a SkyscraperGenerator tower of its own seed, height and footprint, optionally on raised sidewalk slabs (curbs). Returns a THREE.Group ready to add to a scene.

Pass a building material to dress the towers; the sidewalks dress themselves via SidewalkGenerator. The layout is exposed as CityGenerator#layout so the surrounding scene (road markings, etc.) can align to the same grid.

Code Examples

const city = new CityGenerator( { seed: 1 } );
scene.add( city.build( materials ) );
  • What it demonstrates: Typical usage of CityGenerator.

Reference Tables

Constructor

Signature
new CityGenerator()

Key Takeaways

  1. CityGenerator has no documented properties/methods beyond what's shown above — check the source link for implementation details.

Connects To