Jump to content
  • Advertisement
Sign in to follow this  
thegamemaker777

Hieght map?

This topic is 3067 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

Advertisement
Read through each pixel of the height map and get the values that you are using to represent height, then apply the height at that position for whatever height you extracted.

For example:

For each x in heightmap.width
. For each y in heightmap .height
. . Set the height of realmap at (x,y) to heightmap.at(x,y).red

By the way, this sort of thing belongs more in the Game Programming forum.

Share this post


Link to post
Share on other sites
Quote:
Original post by thegamemaker777
OK so I made a height map but how do I make my height map into a real terrain that I can use on my game?



There are sample programs with libaries like the Windows DirectX SDK which do heightmaps (and will also have all the stuff you will need to learn to do 3D programming)

Also try Googling 'heightap code" and see if there are simpler example programs
(including OPENGL) and add your language to the query (ie C++)


The height map the height data for a regular grid of points used to make a
regular pattern of 'right' triangles forming a surface of squares (a mesh).
Usually a 3D 'mesh' is done for the entire map and you have a 'camera point' that moves around on that map giving the viewer a 3D view of the position and facing of that camera.


Share this post


Link to post
Share on other sites
Quote:
Read through each pixel of the height map and get the values that you are using to represent height, then apply the height at that position for whatever height you extracted.

For example:

For each x in heightmap.width
. For each y in heightmap .height
. . Set the height of realmap at (x,y) to heightmap.at(x,y).red

By the way, this sort of thing belongs more in the Game Programming forum.

Oh ok.

and sorry about posting in the wrong section.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!