-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRayTracing.java
More file actions
34 lines (29 loc) · 846 Bytes
/
RayTracing.java
File metadata and controls
34 lines (29 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.awt.*;
import javax.swing.*;
/**
* Creates the JFrame to hold the ray tracing panel for the cube renderer
* assignment.
*
* @author elliothardwick
* @author samhum
*/
public class RayTracing {
/**
* Makes the JFrame and makes and adds the panels.
*
* @param args
* unused parameter.
*/
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setTitle("Sphere Tracer");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// sets up the camera's position and direction to point in.
Camera camera = new Camera(new Vertex(4, 3, 4), new Vector(-0.577, -0.3, -0.577));
RayTracingPanel rayTracingPanel = new RayTracingPanel(camera);
frame.setLayout(new BorderLayout());
frame.add(rayTracingPanel, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}