Starting from:

$30

Homework 1 CS 354, BME 345

Homework 1
CS 354, BME 345

1. (10 points) Consider the following two commands:
glutInitWindowSize(800, 600);
gluOrtho2D(-100.0, 100.0, -100.0, 100.0);
Give the window coordinates for each of the following object coordinates. The origin in window
coordinates will be at the top-left corner.
(a) (0, 0)
(b) (-50, 50)
(c) (-75, -100)
(d) (90, 10)
(e) (0, -40)
Solution:
2. (5 points) Let α, β, γ be scalars, A, B, C be points, and u, v, w be vectors. Answer T/F/? for each
operation. If the operation is defined, answer T. If it is undefined, answer F. If you don’t know, answer
?. Each correct answer is worth 2 points. Each incorrect answer receives -1. 0 points are given for ?.
(a) v − u
(b) v − A
(c) A − v
(d) A + α(B − A)
(e) αA + v
3. (5 points) Find a homogeneous-coordinate representation of a plane. Hint: the answer will be a dot
product.
4. (15 points) If we are interested in only two-dimensional graphics, we can use three-dimensional homogeneous coordinates by representing a point as p = [x y 1]T and a vector as v = [a b 0]T
. Find the 3×3
rotation, translation, scaling, and shear matrices R, T, S, and H, respectively. How many degrees of
freedom are there in an affine transformation for transforming two-dimensional points?
5. (15 points) Derive a rotation matrix where we rotate first about the x-axis Rx(θx), then about the
y-axis Ry(θy), and then about the z-axis Rz(θz). Assume that the fixed point is the origin.
1

More products