#### Archived

This topic is now archived and is closed to further replies.

# Height map based terrain

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

## Recommended Posts

Ok, Ive got a problem with loading a tga heightmap (greyscale) and displaying it on the screen. When I do, it has a triangle going from the far left to the beginning of the next row.. for every row. As you can see in these screen shots which might i add are a pain in the ass to get on this forum . in the second screenshot you can see the terrain thru lines so it is being rendered. sorry about the size... they used to be 5mb each tho... the code that puts this in the display list:
  glNewList(land,GL_COMPILE); for(int y=0;yheight-1;y++) { glBegin(GL_TRIANGLE_STRIP); for(int x=0;xwidth;x++) { glColor3f(tga->imageData[x+((y+1)*tga->width)],tga->imageData[x+((y+1)*tga->width)],tga->imageData[x+((y+1)*tga->width)]); glVertex3f(x,y+1,heights[x+((y+1)*tga->width)]);//255.0f); glColor3f(tga->imageData[x+((y)*tga->width)],tga->imageData[x+((y)*tga->width)],tga->imageData[x+((y)*tga->width)]); glVertex3f(x,y,heights[x+(y*tga->width)]);//255.0f); } glEnd(); } glEndList(); 
I am using code from http://www.fatech.com/tech/opengl/terrain/index.php3?tgalib so i know this should work but it isnt. Thanks allot!

##### Share on other sites
your screenshots didnt show up just rotating xoom logo''s

##### Share on other sites
? They show up normally for me... try right clicking where they should be and show picture... ... it seems that every row the z drops back down to zero after a peak... ... ya somthing like that

if you want me to email u the images/program/src just leave your email/icq # Thanks again

##### Share on other sites
rename your *.jpg files to *.bollux files , xoom doesnt allow direct acces to jpg files

http://members.xoom.com/myBollux

##### Share on other sites
I see what u mean now... on my laptop.. musta had the pics in the cache on my other computer... ill put it on my server after school

*curses at the crappy free hosting sites*

##### Share on other sites
I''m working on something similar, check out my program and see if it is what you are looking for.

http://www.savvynet.com/~joel/

My program loads .RAW files instead of TGA files, so download both the TrackEd.exe and automap.map.

Use the arrows keys and pg-up pg-dn to rotate.

s d f e and keypad + and - move the terrain

home - end modifies the height scale.

click and drag to select, then + and _ (next to backspace) to move that area up and down.

I need some help with the selection, right now I can''t figure out how to directly select the points...

##### Share on other sites
I found a lib that does what I need properly.. the one from the site i mentioned. So im just gonna use that and work on making some p-noise generated terrain.

1. 1
2. 2
3. 3
4. 4
Rutin
17
5. 5

• 11
• 20
• 12
• 11
• 41
• ### Forum Statistics

• Total Topics
631401
• Total Posts
2999869
×