Programming Assignment #2 - CSU540 Computer Graphics - Fall 2005

"The Planets" -- Professor Futrelle

Version of 25 September 2005


Second assignment - Ray tracing of spheres, including transforms

Modeling a few planets (each a single solid color)

First installment due by the end of Thursday, October 6th, emailed as a jar, as in Assignment #1. The first installment is composed of two portions:

  1. Orthographic ray trace, as is already done in the Triangle example. Try a couple of combinations of positions for your planets.

  2. Perspective ray trace. See notes at end. We'll also discuss this in class.

Overview. Our planets are almost perfect spheres. (Our tallest mountains are 5 miles, whereas the earth's radius is 4,000 miles - it's as close to a perfect sphere as a billiard ball.) There is no need to model all our planets, must less their moons or the rings of Saturn. Also, it is not useful, when doing a graphics programming exercise, to try to stay true to the real radii and orbit sizes of the planets, since the orbital radii of the planets are many times greater than the radii of the planets. For example, the earth's radius is about 6,000 km, but its orbital radius, its distance from the sun, is about 150 million km. At the end of this page is a table of basic information about the planets (note that the Sun has 9 moons ;-)

What to do? What you'll do in your assignment, is to create and name four or so 'fake' planets and a 'fake' sun. For example, your sun, at the origin, could have a radius of 50 pixels, and your planets could have radii between 10 and 30 pixels, and orbital radii of no more than 300 pixels. That should fill your display nicely. You might want to add a few small moons - your choice - you get to name them too. Your viewing distances for the scene could vary from infinity (orthographic projection) to, say, 1,000 pixels or even less. Small distances can produce dramatic perspective. Name your planets as you like and give them whatever colors you like. The sun should be bright yellow or some other bright color.

The triangle ray-tracing example: You can build your Planet ray-tracing assignment code by using portions of my Triangle code.
Here is a link to the triangle code, including javadoc, a jar file, etc. (The jar is simple, with just the code.) Here is a brief description of each class in the triangle example, with indications of what you should change.

General remarks about your solar system: You can just place your planets at generally random points around your sun. Be sure to place a few so the partially occlude another one - this will test your ray tracing code.

The second installment, coming up a week or so after the first installment, will be to use linear transforms to rotate and translate your solar system to produce different point of view. You can also rotate the planets to different positions around the sun. For extra credit, you can rotate the moon(s) around their respective planets - a hierarchical compounding of transforms.

Distance
(AU)
Radius
(Earth's)
Mass
(Earth's)
Rotation
(Earth's)
# MoonsOrbital
Inclination
Orbital
Eccentricity
ObliquityDensity
(g/cm3)
Sun0109332,80025-36*9---------1.410
Mercury0.390.380.0558.8070.20560.1°5.43
Venus0.720.950.8924403.3940.0068177.4°5.25
Earth1.01.001.001.0010.0000.016723.45°5.52
Mars1.50.530.111.02921.8500.093425.19°3.95
Jupiter5.2113180.411161.3080.04833.12°1.33
Saturn9.59950.428182.4880.056026.73°0.69
Uranus19.24170.748150.7740.046197.86°1.29
Neptune30.14170.80281.7740.009729.56°1.64
Pluto39.50.180.0020.267117.150.2482119.6°2.03


Go to CSU540 home page. or RPF's Teaching Gateway or homepage