/** Example program to test ray tracer * Extend class version, may be confusing... * @author: Phil Gage */ public class Example2 { static int width = 320, height = 200; // image size static int frames = 1; // number of animation frames // Define scene layout static class ExampleWorld extends World { ExampleWorld () { // Define a light source Light light = new Light ( new Vector3(-100.0, -100.0, -50.0), // XYZ direction new Color (1.0,1.0,1.0)); // RGB color add(light); // Define a sphere Sphere s = new Sphere ( new Point(0.0, 0.0, 500.0), // XYZ center 100.0, // radius new Color (1.0, 0.0, 0.0)); // RGB color add(s); // Define a camera, default view (0,0,1) along Z axis AbstractCamera camera = new CylindricalCamera (this, width, height); add(camera); } } /** Main program for example */ public static void main (String[] argv) { // Define scene and perform raytracing World world = new ExampleWorld (); // For each frame of animation, animate and ray trace // Output file names are frame0.tga, frame1.tga, ... for (int frame=0; frame