A city scene
We've covered a lot of ground with the Three.js API. Let's tie it all together with a project that uses what we've learned about geometry and materials.
So far, we've been working with a single object in our world. If we wanted to move it around, we'd have to change its position
vector. We could create a full scene this way by adding multiple objects and manually positioning them. However, for worlds with more than a few objects, this can quickly get quite tedious. There are several alternatives:
Rectangular layout: This method involves storing a map in some simple format such as a string or an image, where each character or pixel color represents a type of object
Procedural generation: This method involves the use of an algorithm to position objects semi-randomly
Editor: This method involves the use of an external tool to construct the scene, followed by exporting the result (for example, in JSON format), and importing it when the application executes
The rectangular format is the...