# Thread: Simple graphical project, satellite tracking / visualization

1. Originally Posted by thor36
... 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 ...
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.

2. Originally Posted by thor36
Do you mind if I ask for what purpose have you designed such an accurate model of Earth ?
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.

Originally Posted by thor36
About the algorithm that you have just described me for creating a sphere - is it documented anywhere in terms of pseudo code or perhaps even better implemented in OpenGL already ? I can say honestly that 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 - not to mention that I am beginner in OpenGL and that takes a lot of extra effort itself
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:
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)
{
glVertex3d(x,y,z);
glVertex3d(x,y,z);
}
glEnd();
}```
This is totally unoptimized version, but is servers the purpose.The result is shown in the following picture.
Next step is to define texture coordinates and normals. Then put it into a display list, vertex array or VBO.

3. 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

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•