Orbitz

6-8-2005

By Kyle Haughey, for Zoe Wood's CPE 471, Spring 2005


Download Orbitz!

Overview

My project is called Orbitz, because it simulates the orbits of various planets, moons, and stars around each other. My original idea was that it should be basically a gravitational sandbox, where one can create and play with solar systems of various configurations. You might think of it as a game, where the challenge lies not in defeating another player or some artificial intelligence, but in defeating physics itself.

Back to real life...I ended up running out of time, so I didn't get to implement all of the features I wanted to. I didn't get to do atmospheric effects, any sort of GUI to allow you to add/delete/modify objects mid-simulation, lighting, collisions, or saving/loading simulation state. I fully plan to implement these during the summer, and maybe Zoe will let me post the updated binaries for you to play with!

Features:

Physics Model:

Orbitz uses Newton's Law of Gravitation to determine the net gravitational force on an object (and from that, its acceleration), affecting the object's velocity (and thus trajectory).

Newton's Law of Gravity (vector form) is expressed as the following:

where G is the gravitational constant, m is the mass of the object being pulled, mp is the mass of the object doing the pulling, and r is the vector from m's center of mass to mp's center of mass. For this version of the Orbitz program, G has been hard-coded as 1.0 (but will be adjustable in future versions).

Orbitz uses GLUT's idle function and the Windows high-performance timer to simulate motion. Each time the idle function is called, it uses Windows' high-performance timer to determine the period of time that has elapsed since the last time the idle function was called. The application then calculates the instantaneous accelerations of each object, and simulates the progression of the elapsed time by updating all objects' velocities and positions. There is a threshold for the elapsed time above which the simulation will divide the time interval into smaller intervals (each less than the threshold) and will simulate each small interval instead.

Instructions:

Key Commands:

There are five camera modes:

To zoom, you can also use your mouse's SCROLL WHEEL. Scroll UP to zoom IN, and DOWN to zoom OUT.

Screenshots:


Planets orbiting the Sun...


Object motion indicators -- the red line indicates the direction of the object's velocity, the green line indicates the direction of the object's acceleration.


The dots indicate the paths the objects' have traveled so far.

Resources: