Dark Bit Factory & Gravity

PROGRAMMING => Freebasic => Topic started by: rdc on April 04, 2007

Title: Terrain Experiment
Post by: rdc on April 04, 2007
I thought I would try out the terrain tutorial I found in FB. Here's a little quickie. Press space bar to generate new map, esc to quit.

Title: Re: Terrain Experiment
Post by: benny! on April 05, 2007
N1 !
Title: Re: Terrain Experiment
Post by: Paul on April 05, 2007
Thats really cool  :)
Title: Re: Terrain Experiment
Post by: zawran on April 05, 2007
Back in 2004, I was playing around with Blitz3D and terrain generation. I read that exact same tutorial and its really good. I managed to create a terrain tool with which I could generate random terrain that looked decent.

(http://zac-interactive.dk/temp/terrain1.jpg)
(http://zac-interactive.dk/temp/terrain2.jpg)
(http://zac-interactive.dk/temp/terrain3.jpg)

It can create both regular color map, and textured based on up to 8 textures which get drawn accoding to map height and blended into each other. It also has a feature for creating a shadow map based on sun angle and location which could be drawn onto the map, so its static but with Blitz3D it was what many did because it wasn't fast enough for lots of dynamically create shadows.

I can highly recommend that tutorial to anyone remotely interested in terrain generation.

@rdc,  really nice looking considering how fast you have pieced that generator together. It took me a long time I remember to get anything decent looking, but as with everything else, just keep at it, and it will improve over time.
Title: Re: Terrain Experiment
Post by: rdc on April 05, 2007
Nice one zawran. That prog looks quite good.
Title: Re: Terrain Experiment
Post by: zawran on April 05, 2007
If someone wants to play with it, they can get it here: http://zac-interactive.dk/temp/tmg.zip (http://zac-interactive.dk/temp/tmg.zip)
Title: Re: Terrain Experiment
Post by: Shockwave on April 06, 2007
Cheers for linky Zawran :)

Rdc, that's a great first build!

I'm a sucker for terrain stuff, I love all kinds of computer gernerated landscapes, I fell in love with them back in the days of the Amiaga after seeing the ones Corto made in the demo "Substance" although I realise that this is a different method, they are still excellent and make me smile to this day :) I even made a 3D landscape thing for one of the competitions on this forum myself once.
Title: Re: Terrain Experiment
Post by: rdc on April 06, 2007
Thanks. The prog is way too slow, but I liked the simplicity of the method. I have seen much more complicated algos that didn't produce results much better than this. This would probably be of more use with OGL or DX.
Title: Re: Terrain Experiment
Post by: ferris on April 11, 2007
Great job dude :)

I used to do terrains for voxels by generating a fractalplasma.
Title: Re: Terrain Experiment
Post by: rdc on April 12, 2007
cha0s and redcrab did a few improvements on the program. Much faster and looks much better. Src and exe included.

Title: Re: Terrain Experiment
Post by: ninogenio on April 12, 2007
wow very nice rdc

you might be able to get this faster again yousing crt memset to clear your pal and other stuff.
also if you yoused pointer arithmatic in the normilize function instead of x+y*sw that might speed it up a bit more again.
you wont get mouch more speed though just thought it might be worth mensioning.

ohh one last thing /(max - min) that will be slow in that for loop hows about 1.0/(max-min) out side the for loop in the normilize.
Title: Re: Terrain Experiment
Post by: zawran on April 12, 2007
A better color range, looking good there RDC, keep it coming.
Title: Re: Terrain Experiment
Post by: rdc on April 12, 2007
cha0s and redcrab deserve the credit for this version. I just thought I would pass it along since it is much improved over what I did.

Title: Re: Terrain Experiment
Post by: Shockwave on April 12, 2007
Looks very nice indeed, thank you for posting the update :)