import javax.swing.*; import java.awt.*; /** * Simple raytrace in Java 2D - top level driver - was SimplestDraw * @author Bob Futrelle * @version 0.1, 15 March 2005 (was 3 April 2003) * * */ class RTSimplestRaytrace { int height, width; P3d pa, pb, pc; Tri tri; Color[][] colorArray = new Color[20][20]; TinyRayTrace trace = new TinyRayTrace(20,20); public RTSimplestRaytrace() { height = 60; width = 80; } RTDrawer drawer; RTGUI gui; public static void main(String[] args) { RTSimplestRaytrace simplest = new RTSimplestRaytrace(); simplest.setup(); } // main() void setup(){ // Pass the triangle and get the returned Color array. pa = new P3d(0.0,0.0,0.0); pb = new P3d(19.0,0.0,0.0); pc = new P3d(0.0,19.0,0.0); tri = new Tri(pa,pb,pc,Color.red); for(int i =0; i < 20; i++) for(int j=0; j < 20; j++) colorArray[i][j] = Color.black; trace.doTrace(tri,colorArray); JFrame frame = new JFrame(); gui = new RTGUI(width, height); drawer = new RTDrawer(colorArray); gui.setup(frame, drawer); } } // class SimplestRaytrace