9.2 (22 votes)
    GM 6
    January 27, 2007
Dev - DB/form (refering to updated - check code)
    DOWNLOAD (1062)
Dev - make AJAX
Screenshots (3)
Dev - Also, on form submission, use GD to resize the image as a new thumbnail file
Dev - In the submission form, you can now upload a banner image
3D Height-Map Script
I wanted to try my hand at writing a terrain script completely from scratch, and the result turned out to be pretty good, so I figured I'd post it here so others can use it as well. First, check out a few screens of things I have made using this script (with a little help from Terragen and the GMC):

user posted image user posted image

Though it is not perfect, this script will allow you to add terrain like those above (and just about whatever else you can create with a height map, color map, and a texture) to your project. Later on I'll probably post a couple of steps on how to make a terrain like the one in the first picture, but I am sure a lot of you can probably figure that out on your own. I have included a GM6 of an altered version of my model viewer, which will use the script and generate the terrain for you.

This script returns the model file when called, and also returns all the terrain's z values in a global data structure called global.zvals. I have not included a height-checking script for this, but you can use just about any height checking script out there for it, so it shouldn't be a problem. I haven't really had time to program normals into the script yet, and am not sure that I will or not, since the method used to color the terrain in this example does not require it. Of course, you are free to alter it however you see fit though! wink1.gif

The last thing I think I should mention is the modes the script works in. Mode 0 will not color the model at all, which admittedly isn't very useful without normals, but I have included it anyway, just so you can try it out. Mode 1 creates the terrain and applies UV mapping to the model so that one large texture can cover the entire thing. This is useful if you are going for an effect like the first picture above. Finally, mode 2 will allow you to use a second image file as a color map to apply general areas of color to the terrain while also texturing each grid separately. This is useful for adding all sorts of color to the terrain, while also allowing for a more finely detailed texture to be applied. You can see that effect here.

And that just about sums it up. You can download the script and the GM6 terrain viewer below. Enjoy!

Target platforms:

29 Results
1 2 Next

this is a perfect example! brilliantly smooth movement. 10/10
Posted by Wommelbammer January 27, 2007 16:23 - 10.9 years ago
| [#01]

Very nice. But I don't really see what is the big advantage of this above other heightmap loading scripts.

Could you explain a bit more why we should use this and not the scripts that are available yet?

I'm not rating this yet. The rating depends on the answer you give to my question [:)].
Posted by Jesper January 27, 2007 16:25 - 10.9 years ago
| [#02]

simply amazing. 10/10
Posted by DevonX January 27, 2007 16:30 - 10.9 years ago
| [#03]

Posted by trippledean January 27, 2007 16:35 - 10.9 years ago
| [#04]

Posted by JID January 27, 2007 17:10 - 10.9 years ago
| [#05]

It's a rather simple example - what happened to terrain self-shadowing? In this example, you have to do it in the texture - not a very easy way to do it.

But what it does, it does well. 9/10.
Posted by omicron1 January 27, 2007 18:05 - 10.9 years ago
| [#06]

[:O] oH ShiTT. that was good. 10
Posted by LoserHands January 27, 2007 18:09 - 10.9 years ago
| [#07]

wow... this is one of the best I have seen in a while... a long while. Now add a fps example to this so the player can walk on the custom terrain. Then that would make this, one of the best examples on 64d.
Posted by KraZKat January 27, 2007 18:21 - 10.9 years ago
| [#08]

@ omnicron1 you could try to use the normalmapfilter of Nvidia in photoshop. and then apply the R or G channel to the normal image using eah multiply, and you need to change the levels a bit...

Posted by Bryan January 27, 2007 18:30 - 10.9 years ago
| [#09]

...or you could have it do the shadowing on its own.
Posted by omicron1 January 27, 2007 19:06 - 10.9 years ago
| [#10]

I dont get it.....
Posted by basilamer January 27, 2007 19:19 - 10.9 years ago
| [#11]

Pretty cool. Nice terrain too. Good graphics. 9/10
Posted by Crane-ium January 27, 2007 19:36 - 10.9 years ago
| [#12]

Quote: Jesper
Could you explain a bit more why we should use this and not the scripts that are available yet?

I'm assuming you mean the scripts that are already available? I suppose there's no real reason why you couldn't use one of the already available scripts, other than the fact that this one is painfully simple to use. It scales images to fit horizontally and vertically for heightmapping, no matter what size they are. It builds / runs fast. It supports two useful methods of texturing the terrain.

On the downside, it doesn't have normals, and I didn't include a script for height checking... but most of the resourcefuls out there can add this stuff in pretty easily, since it exports the terrain heights to a grid, and the source is fully available to edit however you like.
Posted by FredFredrickson January 27, 2007 22:37 - 10.9 years ago
| [#13]

Ok. Thanks for explaining.

I really think this is a good example and the script is indeed easy to use. I can do such things myself but I think this helps lots of people on the GMC and here who could never figure how to make good terrain from heightmaps.

Good work,

( 9/10 )
Posted by Jesper January 28, 2007 2:59 - 10.9 years ago
| [#14]

I think I missed the point.I couldn't see it. Fucking intel card.
Posted by E-Magination January 28, 2007 4:47 - 10.9 years ago
| [#15]

Cooooooooooooooooooooooooooooool! Why does it say Score: in the caption? 10/10
Posted by castleproductio January 28, 2007 4:56 - 10.9 years ago
| [#16]

Hmm... Not as good as other engines that I've seen (particularily the render speed). Still extremely impressive, don't get me wrong. 9/10
Posted by Juju January 28, 2007 11:29 - 10.9 years ago
| [#17]

hmm... I'm not a big fan of terrain examples... but this is pretty dang good! 10/10
Posted by DarkSoulcalibur January 28, 2007 12:39 - 10.9 years ago
| [#18]

If you look at it from a top view, it looks realy frikkin realistic... like a photo or sumthin, thats just awsome!
Posted by DarkSoulcalibur January 28, 2007 12:46 - 10.9 years ago
| [#19]

Quote: theman
Not as good as other engines that I've seen (particularily the render speed).

This is not an engine, it's just a script that builds terrain. I included the engine as a courtesy so you wouldn't have to set up a whole new game just to see what it does.

Quote: castleproductio
Why does it say Score: in the caption?

That is just a quick and dirty way of showing the FPS on the title bar. [;)]
Posted by FredFredrickson January 28, 2007 13:46 - 10.9 years ago
| [#20]

29 Results
1 2 Next

Recent Activity
Active Users (0)