import graphics.*; public class hw8 extends RayTracerApplet { public void initialize() { super.initialize(); spheres = new Sphere[5]; spheres[0] = new Sphere(); spheres[0].radius = 2; spheres[0].center = new Vector3(0, 0, -22); spheres[0].setDiffuse(0, 0, 100); spheres[0].setSpecular(30, 0, 0, 100); for (int i = 1; i <= 4; i++) { spheres[i] = new Sphere(); spheres[i].radius = 0.75; spheres[i].setDiffuse(100, 0, 0); spheres[i].setSpecular(50, 100, 100, 100); } spheres[1].center = new Vector3(-1, -1, -20); spheres[2].center = new Vector3(1, -1, -20); spheres[3].center = new Vector3(1, 1, -20); spheres[4].center = new Vector3(-1, 1, -20); lights = new Light[1]; lights[0] = new Light(0, 2, 5); lights[0].color[0] = lights[0].color[1] = lights[0].color[2] = 255; ambient[0] = ambient[1] = ambient[2] = 30; } public void animate(long time) { //spheres[0].color[0] = (int)(time/10) % 256; } }