Simple graphical project, satellite tracking / visualization

[QUOTE=thor36;1259048]… I would like to save some sweat, time, nerves and errors with drawing a sphere, since the central point of my project are orbits and physical calculations of spacecraft motion …[/QUOTE] Google gluSphere. It generates all of the vertices and polygons making up a sphere. You have control over the number of lat-lon divisions it generates. Also, if you request, it generates texture coordinates allowing you to wrap a world map image around the sphere without any ugly seams. This is what I use in my sims.

You are smart in the way you’re setting your priorities. You are developing a very small application. No need to spend a lot of time worrying about ultra-efficient OpenGL. Doing the graphics simply will allow you to concentrate on the engineering features of your sim.

I’m a long time in 3D terrain rendering for GIS, and I wanted to develop algorithm to precisely render the whole planet using clipmaps (with cm precision or higher).
Something like Google Earth, but better. :wink:

Being in education for a long time, I prefer not to give students a complete solution. Rather I give them a clue and force them to find solution by themselves.
What I mention is a quite simple math. It needs 5 minutes to be accomplished. But, if you wish a “complete” solution this is the code:


for(double Theta = -90.0; Theta < 90.0; Theta+= dTheta)
{
    glBegin(GL_TRIANGLE_STRIP);
    for(double Phi = -180.0; Phi <= 180.0; Phi+= dPhi)
    {
        double x = r*cos(Theta*toRad)*sin(Phi*toRad);
        double y = r*sin(Theta*toRad);
        double z = r*cos(Theta*toRad)*cos(Phi*toRad);
        glVertex3d(x,y,z);
        x = r*cos((Theta+dTheta)*toRad)*sin(Phi*toRad);
        y = r*sin((Theta+dTheta)*toRad);
        z = r*cos((Theta+dTheta)*toRad)*cos(Phi*toRad);
        glVertex3d(x,y,z);
    }
    glEnd();
}

This is totally unoptimized version, but is servers the purpose.The result is shown in the following picture. [ATTACH=CONFIG]616[/ATTACH]
Next step is to define texture coordinates and normals. Then put it into a display list, vertex array or VBO.

Thank you both, Carmine and Alexandar. I think I am equipped with the basic information I need for now to try tackle the project. Any tips are always welcome of course :slight_smile: