# Hieght map?

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

## Recommended Posts

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?

##### Share on other sites
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 on other sites
Quote:
 Original post by thegamemaker777OK 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

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 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).redBy the way, this sort of thing belongs more in the Game Programming forum.

Oh ok.

and sorry about posting in the wrong section.

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632997
• Total Posts
3009791
• ### Who's Online (See full list)

There are no registered users currently online

×