Sign in to follow this  
The Pentium Guy

Heightmaps - How are they made???

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this