csci5607/exam-2/exam2.md
2023-04-26 14:56:07 -05:00

93 lines
3.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
geometry: margin=2cm
output: pdf_document
title: Exam 2
subtitle: CSCI 5607
date: \today
author: |
| Michael Zhang
| zhan4854@umn.edu $\cdot$ ID: 5289259
---
\renewcommand{\c}[1]{\textcolor{gray}{#1}}
## Reflection and Refraction
1. Consider a sphere $S$ made of solid glass ($\eta$ = 1.5) that has radius $r =
3$ and is centered at the location $s = (2, 2, 10)$ in a vaccum ($\eta =
1.0$). If a ray emanating from the point $e = (0, 0, 0)$ intersects $S$ at a
point $p = (1, 4, 8)$:
a. (2 points) What is the angle of incidence $\theta_i$ ?
First, the normal at the point $(1, 4, 8)$ is determined by subtracting
that point from the center $(2, 2, 10)$, which gets us $N = (2 - 1, 2 - 4,
10 - 8) = (1, -2, 2)$. Then, to determine the angle between
b. (1 points) What is the angle of reflection $\theta_r$ ?
c. (3 points) What is the direction of the reflected ray?
d. (3 points) What is the angle of transmission $\theta_t$ ?
e. (4 points) What is the direction of the transmitted ray?
Using Snell's law, we know that $\eta_1 \sin \theta_1 = \eta_2 \sin
\theta_2$. In this case, let material 1 be the vacuum, and material 2 be
the glass. Then, we have $1.0 \times \sin \theta_1$
## Geometric Transformations
2. \c{(8 points) Consider the airplane model below, defined in object
coordinates with its center at $(0, 0, 0)$, its wings aligned with the $\pm
x$ axis, its tail pointing upwards in the $+y$ direction and its nose facing
in the $+z$ direction. Derive a sequence of model transformation matrices
that can be applied to the vertices of the airplane to position it in space
at the location $p = (4, 4, 7)$, with a direction of flight $w = (2, 1, 2)$
and the wings aligned with the direction $d = (2, 2, 1)$.}
The translation matrix is
$$
\begin{bmatrix}
1 & 0 & 0 & x \\
0 & 1 & 0 & y \\
0 & 0 & 1 & z \\
0 & 0 & 0 & 1 \\
\end{bmatrix}
=
\begin{bmatrix}
1 & 0 & 0 & 4 \\
0 & 1 & 0 & 4 \\
0 & 0 & 1 & 7 \\
0 & 0 & 0 & 1 \\
\end{bmatrix}
$$
Since the direction of flight was originally $(0, 0, 1)$, we have to
transform it to $(2, 1, -2)$.
## Clipping
9. \c{Consider the triangle whose vertex positions, after the viewport
transformation, lie in the centers of the pixels: $p_0 = (3, 3), p_1 = (9,
5), p_2 = (11, 11)$.}
Starting at $p_0$, the three vectors are:
- $v_0 = p_1 - p_0 = (9 - 3, 5 - 3) = (6, 2)$
- $v_1 = p_2 - p_1 = (11 - 9, 11 - 5) = (2, 6)$
- $v_2 = p_0 - p_2 = (3 - 11, 3 - 11) = (-8, -8)$
The first edge vector $e$ would be $(6, 2)$, and the edge normal would be
that rotated by $90^\circ$.
a. \c{(6 points) Define the edge equations and tests that would be applied,
during the rasterization process, to each pixel $(x, y)$ within the bounding
rectangle $3 \le x \le 11, 3 \le y \le 11$ to determine if that pixel is
inside the triangle or not.}
b. \c{(3 points) Consider the three pixels $p_4 = (6, 4), p_5 = (7, 7)$, and
$p_6 = (10, 8)$. Which of these would be considered to lie inside the
triangle, according to the methods taught in class?}