CSCI 480/580 Lecture 19 - In-Class Problems

 

  1. Consider the side-view of a perspective camera shown below: the image looks at the plane from the direction. The scene point at appears in the viewport at . Based on this view, calculate the value of , the y coordinate of the viewing ray’s intersection with the viewport, in terms of the pixel’s 3D coordinates and the camera’s focal length . Hint: no trig necessary! Try similar triangles.

  2. Which of the following 3D homogeneous 4-vectors represent the same point as the point ?

  3. Let's modify the wire.jl code from last time to support perspective rendering.

    1. Let's start by moving the camera so that the cube will appear in front of the viewport. First, move the eye to . Then we'll make a more sensible camera projection plane by putting the viewport in front of the eye: in the orthographic projection parameters, change n from 2 (which is behind the camera) to -2 (in front of the camera).
    2. Augment the orthographic projection matrix with a perspective projection matrix.
    3. In the rendering loop, perform perspective division before dropping the and coordinates: instead of drawing lines between and , we want to draw lines between and .

    If your implementation matches mine, you'll see an output like the following:p3