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

## 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 on other sites
Just create an array of vertices, and set them up accordingly. Then you'll need to generate indices to create actual triangles.

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

1. 1
2. 2
3. 3
4. 4
5. 5
Rutin
11

• 12
• 16
• 9
• 14
• 10
• ### Forum Statistics

• Total Topics
632658
• Total Posts
3007687
• ### Who's Online (See full list)

There are no registered users currently online

×