Saturday, May 21, 2011

Noisy terrain

A quick update. Waiting for a few books to arrive, but in the meantime I've been messing around and finally decided to add some funky terrain.



The way this works, I stored the values of calling the simplex function and then when I drew the ground I replaced the height with the value for the correct point. The grid is 100x100 in the picture. That's 10,000 squares, or 20,000 triangles. I stored the values of the height in double precision, 10,000 points. A double, in this implementation, is 8 bytes. That means it takes 80,000Bytes (78KB) to store just the heights.

Of course, there are ways to make it better. The important thing is that it looks pretty nifty.

That's the result of applying the simplex function only once, by the way. By running it several times at different frequencies and amplitudes, more interesting terrain should be produced.

No comments:

Post a Comment