Ray Tracer
Download this zip file. I've converted all
the C++ code in wxraytracer version 1.0.2 to Java. The textbook's code
is in C++, so you may need to convert some C++ code to Java on your
own later this semester.
Make sure your ray tracer compiles and runs.
Answer questions 3.2, 3.5 and 3.6 on pages 78-79.
Next, complete exercises 3.1 - 3.7 from page 79 in the textbook. You should submit THREE screenshots of your output image for each of exercises 3.3, 3.4, and 3.7.
Math background
Using the classes in raytracer.utility (part of the above ray tracer), write methods in a class (Homework2.java)
that solve the following problems:
- Given three points in a triangle, calculate the unit normal for
the triangle.
public static Normal getNormal(Point3D p0, Point3D p1, Point3D p2)
- Given two non-parallel vectors, return three vectors for a 3D
orthonormal basis (see pages 40-41).
public static Vector3D[] createBasis(Vector3D a, Vector3D b)
- Given a single vector, return three vectors for a 3D orthonormal
basis.
public static Vector3D[] createBasis(Vector3D a)
Geometry
Provide the students with a simple geometry. Have the students:
- Write a main method to generate normals for each face of the
pictured geometry.
- Turn in the completed table.
Last modified: Thu Mar 10 13:06:33 MST 2011