OpenGL - Terrains

Started by
2 comments, last by GameDev.net 18 years, 7 months ago
I have just started to learn OpenGL and I think it's too early to ask, but if I make a terrain using Terragen for example, how can I load it with OpenGL? Thanks in advance.
Advertisement
call the glLoadTerrain function.

Ie, it has nothing to do with OpenGL really.
terragen will output heightmaps. Google for info on heightmaps. To put it simply, you create a grid of vertices by interpreting the colour values from the heightmap as heights. You then render these vertices with opengl. As the AP said, opengl doesn't 'load' anything, but it will render the vertices you pass it.
[size="1"]
You would have to export your terrain to a heightmap, say 256 * 256 RAW file format. Make a program that reads the file and triangulate the data.
for a start try visualize with glpoints

glBegin(GL_POINTS);
while(more points)
{
glVertexf(point.x,point.y,point.z);
}
glEnd();

then you should be up and running

over and out

This topic is closed to new replies.

Advertisement