Hello, I have to create a Solar System, with planets and moons. I calculate the orbit with a function like year=(year+1)%360…

But this way it’s too fast. Is there some kind of function (i.e. sin&cos) to slow down the orbit? Thanks.

Originally posted by Corwin:

Hello, I have to create a Solar System, with planets and moons. I calculate the orbit with a function like year=(year+1)%360…

But this way it’s too fast. Is there some kind of function (i.e. sin&cos) to slow down the orbit? Thanks.

Ah sin cos have nothing to do with the speed but are for trig to figure out a path or distance. What you need is a timer that returns time since the frame render call. This way you can control the framerate so its not so fast like you are seeing.

Look at these sites

http://www.gamedev.net/reference/programming/features/timing/

Many thanks, they have been useful.