CSCI 480/580 Lecture 6 - In-Class Problems

  1. You have a canonical perspective camera (i.e., centered at the origin, looking down the \(-z\) axis, viewport height and width 1, distance to viewport 1). Your image is 400x400 pixels. Generate the viewing ray for the pixel whose index is (100, 200). Write the ray in parametric form (i.e., \(\mathbf{p} + t\mathbf{d}\)). Note: I didn’t design this so the numbers would come out nice - feel free to use a calculator and/or software (e.g., the Julia REPL!) to compute the answer.

  2. Out in the scene, there is planar object occupying the entire plane at \(z=-6\).

    1. What is the value of \(t\) at the intersection point of the ray with the plane?

    2. What are the values of \(x, y\), and \(z\) at the intersection point?

  3. Let’s break some assumptions and generalize our camera model. We assumed:

    In the following, you may assume that the conversion from \((i,j)\) to (\(x, y\)) has been done already - feel free to express your answer in terms of \(x\) and \(y\). For each one, assume that the camera is canonical in all other respects.

    1. Write the viewing ray for pixel \((i, j)\) in a camera that is canonical except its eye is at a given point \(\mathbf{c}\).
    2. Write the viewing ray for pixel \((i, j)\) in a camera with a distance \(d\) to the viewport.
    3. Write the viewing ray for pixel \((i, j)\) in a camera with a viewport witdth \(v_w\) and height \(v_h\).
  4. If you have time, ponder this: what if the camera’s orientation is different, i.e., the camera points in a direction other than the -z axis?