3D Terrain Engine v0.11

56,788
0
Published 2014-08-01
Enjoy a virtual run around the lakes and hills!
NOW with a few added trees, and MINIMAP! :)
And see how many piles of stones you can find on the hilltops...
Note how an object can be made walkthroughable (palm trees), or not (other trees, and stone piles).

Mouse to look around, W/S (or up/down) to walk forwards/back.
Alternatively, hold down mouse button to walk forwards (in case you suffer from keyboard lag, e.g. if using Chrome - also try here:
http://scratch.mit.edu/projects/embed/25217786/ )

As I develop this further, I will add more kinds of items, not just stamped costumes. For example, walls and pen-drawn objects.
These objects do have a fairly significant speed impact, unfortunately - the real trick, though, will be to make them rotate!

Cartoon trees copied from turbosquid.
The tri/quad fill for the ground is based on the one here:
http://scratch.mit.edu/projects/24828481/

The cell heights were generated just using a fairly complicated set of interlocking sin/cos functions with different periods, and putting water wherever it goes below a certain height. Something more realistic could be made, as well as adding some specific landscape features (e.g. meandering rivers, etc.)

The grid has 400x400 cells, and the colours, including the shading, are precomputed based on direction of a light source. However, there is a slight light-blueness increase applied for greater distances. It also has a multiplier for ambient light level, but that doesn't affect objects (like trees), so I've left it out from the controls. I also added multipliers for ambient light temperature, which basically worked, but slowed it down a bit too much, so I didn't keep the code for that in the scripting.