yanwen-map

Description

This is a terrain generator which generates random terrains with different levels of heights. It also generates two types of trees of various sizes with random positions on the terrain.

Process

I was inspired by this dynamic webgl example and decided to create a static version. I first created the terrain using PlaneBufferGeometry and displace the vertices of the plane randomly when generating different results.

Then I used the positions of the vertices of the plane to place the trees onto the terrain. I decided to use a set number of trees but tweak the sizes and dimensions of the results. Each type of trees has its own set of positions and is regenerated when space bar is pressed.