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.
(5 pts) Consider the plane in 3D that contains the \(z\) axis and the vector \((1,1,0)\).
(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.
(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\).
(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:
(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\).
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.↩︎