Professional Documents
Culture Documents
Computer Graphics (0303481) (9112281) : EX01
Computer Graphics (0303481) (9112281) : EX01
EX01
Q1:
a) Consider the frame given by the origin (0, 0) and the two vectors u = (1, 0) and v = (1, 1).
The point P, having coordinates (5, 3) in this frame, can be written as
5u + 3v + O
or
5 < 1, 0 > +3 < 1, 1 > +(0, 0)
What is the Cartesian coordinate of the point P.
b) Consider the frame given by the origin (2, 2) and the two vectors u = (1, 0) and v = (0, 2).
The point P, having coordinates (5; 3) in this frame, can be written as
5u + 3v + O
or
5 < 1, 0 > +3 < 0, 2 > +(2, 2)
What is the Cartesian coordinate of point P.
c)
Given a Frame F = (u, v, w, O), let FC be the Cartesian frame
(< 1, 0, 0 >;< 0, 1, 0 >;< 0, 0, 1 >; (0, 0. 0))
If we have a point P that has local coordinates (u, v, w) in the frame F, what coordinates does
this point have with respect to the Cartesian frame?
Q4: Consider a game where the model-matrix (the position and orientation) for a car is described
by a translation matrix, T, and a rotation matrix, R, as given below.
1. When the user presses a key, the car should move 2.0 units in the world-space x direction.
How would you modify the translation matrix?
2. How would you modify the rotation matrix for the car to turn slightly to the left?
3. When the user presses the "up-arrow" key, the car shall move forward in the direction it is
facing. How do you modify the matrices?
4. We now want a camera from inside the car (at the car's position and facing in the rz direction).
How can you calculate this matrix?
Q5: Suppose we start with a primitive that is drawn with the following coordinates.
Use the matrices T(x, y, z), S(x, y, z), and R(θ) (we are assuming that rotation occurs around the z-
axis) to construct the transformation matrix that can be used to render each of the following
houses.