OpenGL help

Soldato
Joined
22 Oct 2005
Posts
2,883
Location
Moving...
Hi guys, just started learning some OpenGL and GLUT in C. I want to recreate something similar to google earth but instead of using photo images i'm just goin to use terrain data which i've got. So basically I want to make the world lumpy!

What would be the best way to go about this using OpenGL? The data I have is basically the longitude and latitude of a point, then the height above sea level at this point. I'm guessing I would need to create a sphere to represent the Earth then put some kind of wireframe model over the surface to detail the terrain, then just add some colour? Is there any specific functions that would be useful/I should avoid?

Thanks.
 
Yup. Implement your own sphere subdivision algorithm (google search for the method) and then simply normalize the length of the vector to each vertex to equal the height you want at that point.
I've had a look but all I can find about sphere subdivision algorithms is to do with making the sphere more rounded, i.e. turning an icosahedron into a more spherical looking object by subdividing the triangles which make up the surface???

I understand what you're saying but I'm not sure how I would go about coding the solution.
 
Thanks for all the replies guys.
Is a "flat" earth an option? You could use SRTM data and just render a regular heightfield. The .hgt file format is quite simple. Much easier to visualize and implement than a sphere.
I think this may be a more viable solution for me, I've been doing some research and the performance problems I would encounter trying to render the whole globe at once would be a big problem. So i think i'm gonna go with the more traditional view (i.e. a few countries in view at the same time) and focus more on accuracy and a nice camera engine for a nice degree of freedom for the user.

On a side note, what are the limitations on the sizes of the arrays that can be used in C/openGL, either physical restrictions, or a size that would be too large to run in an 'acceptable' timeframe if you know what I mean?
 
Back
Top Bottom