# CS 447/547: Computer Graphics Homework 3 solved

\$35.00

Category:

## Description

Question 1: We have an orthographic view volume that is defined by the following 6 planes:
near plane: n=-2; far plane f=-6; left plane l=-2; right plane r=6; top plan t=4; bottom plan b=-4.
We need to transform this orthographic view volume to canonical view volume, which is the cube
[-1,1]×[-1,1]×[-1,1]. Compute the projection matrix from the orthographic view volume to the
canonical view volume. (2 points) (Hint: read page 41 of Lecture 7)
Question 2: We assume a basic perspective projection as illustrated in the following figure.
Here a 3D point P(xv, yv, zv) in the view space is projected onto the image plane P(xs, ys). We
know that the focal distance d=10.
a. We know the coordinate of a point in the view space is (100, 20, 20). What is the
coordinate of this point in the image plane? (2 points)
b. We know the coordinate of a point in the image plane is (20, 10). Can we uniquely
determine its corresponding 3D point’s coordinate in the view space? (1 point)
Question 3: You wish to use compositing operations to perform a stencil operation. You have a
foreground image, f, which you wish to place into a background image, b, only at places where a
stencil mask, s, has a particular α value.
For example, of the foreground image is all white with α = 1, the background is all red with α = 1
and the stencil has holes for a word, inserting the foreground into the background would result in
a white word on a red background. Assume that the α value in the stencil is 1 in the holes and 0
elsewhere. You plan to use two compositing operations to combine the images, with the form
(f op1 s) op2 b, where brackets indicate precedence. Which compositing operations would you use
for op1 and op2? (2 points) (Hint: this is a challenging question. A brute-force way to solve this
problem is to try different combinations of the compositing operators. In this way, you will
prepare yourself well for the midterm on this topic. There is a more creative way to solve this
problem easier. )
Question 4: It takes 3 pairs of point correspondences to determine a 2D affine transformation
shown as follows:
[
𝑢
𝑣
1
] = [
𝑎 𝑏 𝑐
𝑑 𝑒 𝑓
0 0 1
][
𝑥
𝑦
1
]
We know that [1, 1] is transformed to [√3+1
2
,
√3−1
2
], [0, 0] is transformed to [1, -1], and [1, 0] is
transformed into [
√3+2
2
,
−1
2
].
Compute the values for the unknowns a, b, c, d, e, and f. (Hint: you can set up two linear
equations for each pair of points, so eventually you get six linear equations. You can verify
whether you get the right answers or not by use your answers to form the affine transformation
matrix, and transform each (x, y) to its corresponding (u, v). ) (3 points)