Framework Comment Corrections and Clarifications

1. 1. RayTracer.java - renderImage() - under TODO(A) Remove the following:
// solving the quadratic equation for t at the pts of intersection
// don't forget to check the discriminant and update the intersection record
You can write only ONE line of code to call your camera's getRay() with correct parameters.

2. Camera.java - initView()
// 1. set basisW to be parallel to projection normal but pointing to the opposite direction.
Should be "set basisW to be parallel to the projection normal pointing to the same half space as viewDir." I'll explain what it means below.

3. On the assignment page 10, It says projNormal by default is equal to the view direction, BUT it doesn't mean projNormal = viewDir. This will probably confuse you, but I'll explain everything below.

Please look at this image:

viewDir is the viewing direction.
- The 3 red vectors (basisU, basisV, basisW) provide the axes for your image.
U represents x-axis, V represents y-axis, and W by definition is the cross product of U and V. So that's why W is usually pointing the opposite direction of the viewing direction.
- viewUp is just a vector that points to the sky and isn't necessarily parallel to basisV. As you can see from the second scene. The camera setup in the second scene is exactly the same as in the first scene except the viewUp points downward. In this case, it's like you take the same picture but you rotate your camera 180 degree or turn it upside down.
- projNorm is just the normal vector of your image plane. It can point to either one of the two directions, which we don't know. So you might ask "why do we even need projNorm if we can setup the basis using normalized viewDir instead of projNorm?"


In the third scene, now projNormal + basisW are not parallel to viewDir. In photography, this can be done using perspective control lens, which are used a lot in architectural photography:
http://en.wikipedia.org/wiki/Perspective_control_lens

Notice that the building contours are now undistorted and parallel to the axes.

The camera model we provide in the framework also supports this not-normal-to-image-plane viewing direction. But in most cases, the viewDir and projNorm are parallel (though, may have opposite direction).

So now,
To find basisW, you want to set it to either the given projNorm or -projNorm. You want to pick the one that the dot product of basisW and viewDir is < 0 so that basisW points backward to your camera and in the opposite direction of viewDir.

To find basisU, think about the cross product and view Up.
To find basis V, I won't tell you :)

Hope this makes things clearer,
Supasorn