Jump to content
  • Advertisement
Sign in to follow this  
Vladk10000

OpenGL - Terrains

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
call the glLoadTerrain function.

Ie, it has nothing to do with OpenGL really.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!