Jump to content
  • Advertisement
Sign in to follow this  
The Pentium Guy

Heightmaps - How are they made???

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

Hey, I got a basic heightmap done (8-bit) and I converted it to a RAW file - so its 1 bit per pixel ;) I figured out how to read the file and "extract" the data (for example store a Y value for each X and Z) The top left of my heightmap is black, so: (0,0) = 255 .... the format used is below: (x,z) = y Now my next question is, how on earth do i go about assigning a Y (height) value for each X (left/right) and Z ("depth") value to my heightmap? I beleive that I'm supposed to use a Mesh right? How do i assign the height for the mesh? If i'm not supposed to use Meshes, what am i supposed to us, and how to i set the height for that? Pent

Share this post


Link to post
Share on other sites
Advertisement
Just create an array of vertices, and set them up accordingly. Then you'll need to generate indices to create actual triangles.

Share this post


Link to post
Share on other sites
Vertices eh? It never came to my mind..
what Primative Type shoud I use? TriangleList or TriangleStrip?

TriangleList would cost memory, but Triangle Strip is complicated as it must be done in Counterclockwise "Winding" order (confusing)

And about the comment about indices - is it necessary? Indices can get very complicated.

Pent

Share this post


Link to post
Share on other sites
Indices are a good idea in this case. Every vertex is part of 4 triangles. Indices will reduce your memory usage by 75% if you just used a triangle list, and probably 33% to 50% if you use strips or anything else 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.

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!