|
2/11/02 The assignment is as follows: Using "the one true way" implement a model of a 35mm camera with a 15mm focal-length lens. Use your camera to image points arranged at the corners and edge-centers of a box about the size of a cereal box (20 points in all, about 12 inches tall, 8 inches wide, 3 inches thick). Antialias the images of the points. Make a short movie, animated GIF, or sequence of still pictures showing your camera viewing the points from a gradually changing position. I wrote this up in Matlab using the "one true way" but used a function that converted from fovy, aspect ratio, look vector, and up vector as inputs because I am more familiar with these parameters. There is something wrong with either my matrix or the way I display the results that makes the image appear rotated 90 degrees. I couldn't find any reason that the matrix would swap x and y either in world or screen space so I presume that it is the display. I would like to investigate this further but I have other assignments to work on. I will eventually come back to this. update: I didn't realize that Matlab reverses x and y in images. It makes sense, but it was very frustrating to figure this out while doing another assignment The code I wrote uses a field of view in the up direction and an aspect ratio. I figured out that for 35mm film with a 15mm focal length the field of view is 38.6598 degrees and the aspect ratio is 1.2984. I choose the resolution of the image to be 78 * 100 so the the aspect ratio of the image would be approximately that of the camera. My code uses a distance parameter which really has no effect. It was supposed to be the distance along the look vector to the image plane, but because there is no near/far clipping it has no effect. |