Drawing terrain as triangles (from heightmap)

Started by
23 comments, last by Funkymunky 17 years, 4 months ago
Quote:Original post by jett
Mine runs at 4fps. Im using OGLFT to render fonts, but i dont think it could push it down that much.


What makes you think the difference in framerate has anything to do with quads v. triangles? Did you run a profiler on your code and find that the rendering of the quads was what was slowing you down? If you really want to speed up your rendering you want to use triangle strips and vertex arrays instead of glVertex3f(...)

Anyway, did you put in some hardcoded triangles? Do they draw?

-me
Advertisement
Yes, hard-coded works, i had to move the camera but it works.

I repeated the process, with the camera moved.

Nothing
you are declaring your vertices in a clockwise order?

Are you sure that your hmap array is being loaded correctly? I would try some basic debugging to see what each variable is at each point in the program's execution, and what functions are called when.
Im loading it like this:

function Pull(BYTE *hmap, int nsize, filename)

open filename, fread hmap 1 nsize file

close filename

exact code in post #3(i think)
Try debug strings. At key points throughout the code do a dump where you printf or cout or whatever the contents of your variables. This way you can be sure that stuff is allocated correctly and that calculations have been done properly

This topic is closed to new replies.

Advertisement