Jump to content
  • Advertisement
Sign in to follow this  
saggar

Elevation Algorithm in Terrain

This topic is 4736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all, i want to develop 3d RTS game like C&C Generals, SimCity4 etc... i need some help from gurus. i want to create terrain editor in first phase. i want to know the algorithms for elevatoin. i want to add clifs/mountains on mouse click on the terrain. i mean how can i add heights in terrain on mouse clicked position. thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
The most common technique for (easy) terrain is height mapped. Using either .raw or .bmp files for information. There is a tutorial on using .raw height maps on NeHe's site (nehe.gamedev.net) or there are various other ones around. As you posted in the OpenGL forum I'll assume you're using OpenGL. Google "heightmap"+"opengl" and I'm sure you'll find a lot of stuff that's helpful.

I also know that FireStorm is releasing a tutorial with heightmaps in it, his website is firestorm.go.ro.

Hope thats helpful.

Share this post


Link to post
Share on other sites
You might consider checking out libnoise, http://libnoise.sourceforge.net/

It looks like it could potentially be the back end for a powerful and very configurable terrain generator. I'm using it on an RTS-like game via a custom editor and it's working nicely so far.

Share this post


Link to post
Share on other sites
hi,

thank you friends for your answer. but i don't want to use height map. i want to draw plane surface using textured GL_QUADS. i want to add height using mouse like SimCity4. where i click on the plane surface.


thanks

Share this post


Link to post
Share on other sites
excellent! then don't use GL_QUADS, use triangle strips, and use a heightmap. How else do you expect to get it done? The terrain height will not raise magically with a mouse click unless you make it so. That would be my suggestion too, it is the quickest and easiest way to get it done.

BTW traditionally SimCity has used splines (bicubic surfaces) to model its terrain, and I imagine they used a fixed step subdivision based on the city grid to get that simplified "blocky" look. I also imagine that you could use a predefined set of tiles (split the 2 triangles in the quad different ways to get the terrain looking correct). You could try something along those lines.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!