Live data from Hacker News

Realistic terrain in 130 lines of JavaScript

playfuljs.com

51–57 of 57 posts

Re: Realistic terrain in 130 lines of JavaScript

#51

after thinking about this one for a while, it occurred to me that this really helps illustrate the point of 'Life May Be A Computer Simulation'. Take this world creation a step further, and rather than teaching a computer how to create rocks, each one slightly different, imagine creating humans, each one slightly different. If you think about 'God' as just some alien programmer dude, it helps make so much sense of th…

You realize you just explained a caring God by saying he doesn't care, right?

Re: Realistic terrain in 130 lines of JavaScript

#52

Just a small note, not to sound snooty, just to educate people on what realistic terrain looks like... This is what midpoint displacement looks like as a heightmap: http://imgur.com/ksETpO0,7gykFEV#0 This is what realistic terrain looks like (this is based on real-world heightmap data): http://imgur.com/ksETpO0,7gykFEV#1 That said, midpoint displacement, perlin/simplex noise, etc are good for modeling terrain at a le…

Interesting. Those branchy ridge shapes look a lot like Diffusion-Limited Aggregate patterns. But then, I guess they didn't call it "universality" for nothing :) They also reminded me a bit of GIMP's "Solid Noise" rendering with the "Turbulence" setting switched on. I rendered one, and turns out it doesn't quite look as good (cough), but now I wonder whether this would give a bit more realistic height map: http://img…

Using a noise function I produced similar turbulence once. Here was my result (it does, IMHO, look a bit better than vanilla noise):

http://www.gavanw.com/uploads/9/5/4/0/9540564/4868178_orig.p...

Re: Realistic terrain in 130 lines of JavaScript

#53

after thinking about this one for a while, it occurred to me that this really helps illustrate the point of 'Life May Be A Computer Simulation'. Take this world creation a step further, and rather than teaching a computer how to create rocks, each one slightly different, imagine creating humans, each one slightly different. If you think about 'God' as just some alien programmer dude, it helps make so much sense of th…

You realize you just explained a caring God by saying he doesn't care, right?

I meant, a common human question is "if there is a caring God, how can there be so much suffering in the world?" And maybe the answer is, human pain means nothing to him the same way computer generated rock pain means nothing to us.

Re: Realistic terrain in 130 lines of JavaScript

#54
post #45

Brings me back to a ray casting experiment I did a while ago [1]. I always wanted to revisit it to include a terrain generation step (it uses a pregenerated height map). Now I have an excuse! ;) [1] http://namuol.github.io/earf-html5

Wow! Really fantastic. I've already linked to your raycaster; let me know if you build one that dynamically generates the terrain as well.

Re: Realistic terrain in 130 lines of JavaScript

#56

Nice demo. I made a terrain rendering engine/demo in WebGL a few months back, that used Perlin noise: http://felixpalmer.github.io/lod-terrain/ If anyone wants to play around with Hunter's algorithm in WebGL, it should be pretty straightforward to swap out the Perlin Noise implementation for his. Note the shaders do a fractal sampling of the the height map, so you may want to disable this.

I love how you're using a simple but effective dynamic LoD. I'm going to riff on this a bit with a first-person ground-level camera.
Post reply on HN