CSCI 480 / 580 - Written Homework 1

Complete the following problems and submit your solutions to the HW1 assignment on Canvas. For all questions, justify your answers either or showing your work or giving a brief explanation. Please typeset your solutions using latex or similar1. You may work with your classmates on these problems, but you must write up your own solutions individually without using notes or photos made during your collaborative discussions. As usual, this is new material, so please let me know if you think anything is unclear or ambiguous and I’ll make corrections or clarifications as needed.

  1. (5 pts) Consider the plane in 3D that contains the \(z\) axis and the vector \((1,1,0)\).

  2. (5 pts) It tends to be the case that when finding the intersection between two geometric objects, the math is nicest when one is parametric and the other is implicit. Write pseudocode for a routine to calculate the \(x, y, z\) coordinates of the intersection point between the following two geometric objects:

    If the ray does not intersect the plane, your procedure should return Nothing.

  3. (15 pts) [This problem will help you with the sphere mesh part of A1; The optional L05C video may be helpful - it solves a similar problem under a different parameterization of the sphere.] In A1, we describe the parameterization of a unit sphere using the familiar concepts of latitude and longitude. Here, the sphere is oriented with the poles at \(y = \pm 1\), zero latitude at the equator (the \(xz\) plane) and zero longitude at the meridian that lies in the \(+z\) half of the \(zy\) plane, so the point (lat=0, lon=0) is at \(z = 1\).

    1. Given two angles lat and lon, derive an expression for the \(x\), \(y\), and \(z\) coordinates of the point.
    2. What is the surface normal at a point with a given lat, lon?
    3. The texture mapping function used in A1 relates \(u\) to longitude and \(v\) to latitude. In particular, \(u\) starts at 0 at the \(-180^\circ\) meridian and increases linearly with longitude such that it is 0.5 at the prime (\(0^\circ\)) meridian and reaches 1 at the \(+180^\circ\) meridian (which meets up exactly with the \(-180^\circ\) meridian). \(v\) varies with latitude, ranging from \(0\) at the South pole to \(1\) at the North pole, hitting \(0.5\) at the equator. Give an expression for the \(u\) and \(v\) coordinates of a point with given lat and lon coordinates. There are a few special cases where the answer is ambiguous, such as at the poles and the antimeridian, where the texture coordinates depend on which triangle the point is a member of. You can ignore these cases for this problem, though you’ll need to get them right in A1.
  4. (9 pts) Consider the geometry of a triangle mesh approximating a cylinder as implemented in A1 with \(n = 6\). Assume that each position coordinate value is stored as a 32-bit float and, where applicable, indices are stored as 32-bit integers. Calculate the number of bytes required to store the mesh’s geometry only (no texture coordinates or normals), stored using each of the following data structures. Assume there is no overhead required for distinguishing coordinates from indices, strips from fans, etc. Show your work:

    1. Triangle set
    2. Indexed mesh (as in A1)
    3. One indexed triangle strip for the shell and one triangle fan for each cap.
  5. (6 pts) Consider a perspective camera in canonical pose (centered at the origin, looking down the -z axis). Assume the viewport is orthogonal to and centered on the \(-z\) axis. This camera’s horizontal field of view is the angle between the left-most viewing ray in the \(xz\) plane and the right-most viewing ray in the \(xz\) plane. Rather than specifying the viewport size and distance, a user might want to specify the viewport size and field of view. Derive a formula to set the value of \(d\) (the distance to the viewport), given desired viewport dimensions \(v_h, v_w\) and horizontal field of view \(\alpha\).


  1. My approach to writing writing documents like this one is to use Markdown and include Latex-style math inline (e.g., $\frac{a}{b}$). Then, I use pandoc to convert to either HTML or PDF, which renders the math nicely. You can also find WYSIWYG Markdown editors that make the editing process nicer and allow you to export straight to PDF. You can download the markdown source for this document here.↩︎