A question was posted on the Real Studio forum about rotating spheres in OpenGL. I remembered that the “red book” had an example of doing this. So I whipped up a little port of the demo. Some code from the red book is listed here. Site Here ..
The brown sphere represents a planet, the blue, smaller planet spins around the other one. I added depth testing so the blue planet is not drawn as it goes behind the brown one. I’m on a Mac, you’ll have to see if it runs on your PC.
If you click on the window, the animation will toggle.
Download Project Here …

Hi, All your works a re very interesting. I’m curios and I would to know if there is any possibility with open gl to show molecular particles in a 2D and 3D view, maybe with some mouse interaction by the canvas container.
All the best,
Massimiliano.
Yes. It’s very common to use OpenGL in this manner. There is quite a lot of work to get to this stage however. OpenGL is just a renderer, you’d have to feed it all of the model data and write “picking” code for the mouse to rotate the molecule. Google it.