OpenGL - Terrains
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.
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.
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
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
Popular Topics
Advertisement