Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
DHTML/JavaScript

How do I make orbiting planets in dhtml? Pages that link to <a href="https://ozoneasylum.com/backlink?for=5005" title="Pages that link to How do I make orbiting planets in dhtml?" rel="nofollow" >How do I make orbiting planets in dhtml?\

According to Slime, Orbits are caused by the struggle between the acceleration of gravity pulling the object inwards, and inertia (the object's natural tendancy to go forwards.) When these two things work together, the object tries to move to the side, but then is pulled in a little bit, then moves to the side, and is pulled in again, causing it to go in a circle.



Note that the "pulling" is only done on the velocity, which in turn changes the way that the object moves. The object's position itself isn't changed directly by acceleration. (acceleration changes velocity, velocity changes position.)

And all that's necessary to cause this effect is to continually pull the velocity vector towards the gravitational source. This is done by adding (the direction to the gravitational source times some constant) to the velocity vector.

----------------------------
Relevant threads:

FINALLY started controlling my movements with vectors

Sliding animation with acceleration & deceleration math?

----------------------------
Relevant links:

JavaScript Bouncing Balls

______________________

(Edited by: InI on Tue 08-Oct-2002)

(Edited by: Emperor on Wed 09-Oct-2002)

« BackwardsOnwards »

Show Forum Drop Down Menu