/** Example program to test ray tracer * @author: Phil Gage */ public class Example1 { static int width = 320, height = 200; // image size static int frames = 1; // number of animation frames // Define scene layout static World buildWorld () { World world = new World(); // 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 // Light.ambient = new Color (0.2, 0.2, 0.2); world.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 // s.ks = 0.9; //mirror // s.kd = 0.1; world.add(s); // Define a camera, default view (0,0,1) along Z axis AbstractCamera camera = new CylindricalCamera (world, width, height); world.add(camera); return world; } /** Main program for example */ public static void main (String[] argv) { // Define scene and perform raytracing World world = buildWorld (); // For each frame of animation, animate and ray trace // Output file names are frame0.tga, frame1.tga, ... for (int frame=0; frame