/Users/lyon/j4p/src/graphics/raytracers/rmiRaytracer/raytracer/Main.java

1    package graphics.raytracers.rmiRaytracer.raytracer; 
2     
3    import java.awt.*; 
4    import java.util.Vector; 
5     
6    // graphics.raytracer.Main 
7     
8    public class Main { 
9     
10       public static void main(String args []) { 
11           int size = 100; 
12           int increment = 50; 
13           for (int i = 0; i < size; i = i + increment) { 
14               System.out.println("i=" + i); 
15               //RayFrame rf = new RayFrame( 
16               //  new Dimension(i,i+increment),size); 
17    
18               asynchronousLaunch(i, increment, size); 
19           } 
20    
21    
22       } 
23    
24       public static void asynchronousLaunch( 
25               final int i, 
26               final int increment, final int size) { 
27           Runnable r = new Runnable() { 
28               public void run() { 
29                   long start = System.currentTimeMillis(); 
30                   new RayFrame(new Dimension(i, i + increment), size); 
31                   long end = System.currentTimeMillis(); 
32                   double time = (end - start) / 1000.0; 
33    
34                   System.out.println("done! in:" + time + " seconds"); 
35               } 
36           }; 
37           Thread t = new Thread(r); 
38           t.start(); 
39       } 
40   } 
41    
42    
43   class PolygonTarget implements Target { 
44       Vector vertexList; 
45       Vec planeNormal; 
46       static Targets scene; 
47    
48       public PolygonTarget() { 
49       } 
50    
51       public PolygonTarget(Vector vl, Vec pn) { 
52           planeNormal = new Vec(pn); 
53           vertexList = (Vector) vl.clone(); 
54       } 
55    
56       public double intersectTest(Vec R0, Vec R1, int object) { 
57           System.out.println("Polygon intersect Test"); 
58           return 0.0; 
59       } 
60    
61       public int shade(int object, Vec R1, double t[]) { 
62           return 0; 
63       } 
64    
65       public void debug_test() { 
66           System.out.println("PolygonTarget.debug_test():"); 
67       } 
68    
69       public void setScene(Targets s) { 
70       } 
71    
72       public boolean isBelongingToScene() { 
73           return false; 
74       } 
75   } 
76    
77