View Full Version : 3d moon orbiting the planet

12-03-2000, 01:34 PM
I am writing a small prgram that a palent orbiting the sun and teh moon orbiting the planet. when I run the progrma i press a key to make the planet orbiting. what I need is that as soon as the program is executed the orbiting should start.
could you help? pelase.
thanks in advance.

12-04-2000, 01:28 AM
Are you asking how to make the planet and moon orbit or something else?

I did a fully featured solar system once for a game, with moons and planets, all with (semi) accurate topological data.

mail me some more specific questions if you like.


12-04-2000, 02:04 AM
i think you mean that you wnat it to move without pressing a key??
you need to remove the for loop from the display function (if you are using one). make any variables global not local in the display function.
then put glIdleFunc(Display);
in the main function. this should work.
if not then you will have to show a copy of you code.


12-04-2000, 02:44 AM
I think you mean glutIdleFunc(display);
use this, if you use GLUT. if you are coding direct with mfc, you have to overload the OnIdle() func with a display(); call.