Computer Graphics 1996

Exercises on Cameras

Answers to some of these exercises are available.

These are for the exercise classes. Questions that have a * besides them are more difficult and should be considered at some time, but not necessarily now.

1. An isometric perspective projection is one where the viewplane intersects the principal axes at equal angles. In particular we require a view where the viewplane intersects the negative X, Y and Z axes. The View Reference Point is at the origin, and the viewer is looking towards the origin. The viewplane is one unit distance from the VRP, and the Center of Projection is one unit distance from the viewplane, on the opposite side of the viewplane from the VRP, and on the viewing axis specified by the view plane normal. The line segment (0,0,0) to (0,0,1) should appear vertical in the projection.

(a) Construct the matrix which transforms from World Coordinates to Viewing Coordinates, given the above view.

(b) Find a formula giving the projection of the point (x,y,z) in world coordinates, on the viewplane.

2. Consider the following function:

void lookAt(double eyex, double eyey, double eyez, 
	double centerx, double centery, double centerz, 
	double upx, double upy, double upz);
This specifies a viewing matrix. The desired viewpoint is specified by eyex, eyey, eyez. The centerx, centery, centerz arguments specify any point along the desired line of sight, but typically they're some point in the center of the scene being looked at. The upx, upy, upz arguments indicate which direction is up (that is the direction from the bottom to the top of the viewing volume.

Show how to implement this function by using the functions of the abstract camera model.

3*. Consider the following function:

void perspective(double fovy, double aspect, double zNear, double zFar);
Creates a matrix for a symmetric perspective-view frustum. The fovy argument is the angle of the field of view in the x-z plane; its value must be in the range [0.0, 180.0]. The aspect ratio is the width of the frustum divided by its height. The zNear and zFar values are the distances between the viewpoint and the clipping planes along the negative z axis. They should always be positive....The default viewpoint is at the origin and the line of sight points down the negative z axis

(a) Show how to implement this function using the functions of the abstract camera model.

(b) This function defines a fixed camera, because of the default viewpoint and line of sight. The manual says "...you can apply rotations or translations to change the default orientation of the viewing volume." What does this mean and how can it be used to get an arbitrarily positioned and oriented camera?