CS计算机代考程序代写 CG Tut 2

CG Tut 2

1

Tut 2

Qn 1

Suppose an object is to be scaled up in the direction of the X axis by a factor of 1.5,
then rotated about the Z axis by 30o and finally translated a distance of (0, 60, 0).

a) Write the composite transformation matrix in homogeneous coordinates.

b) Write the OpenGL code.

c) Suppose the order of translation and rotation are exchanged, will the composite

transformation be the same? Why?

Qn 2

The following figure shows four coordinate systems 1, 2, 3, 4 that any point P can be
expressed:

Find i) M2←1 ii) M3←2 iii) M4←3 iv) M1←4. Express in homogeneous
coordinates.

2

Qn 3

The coordinate systems of the control tower and an airplane are shown below:

The position of the plane is (5, 10, 5). The direction of flight is North East with an
inclination of o30 . The plane has no banking.

Find the 4 x 4 coordinate system transformation that transforms the plane coordinate
system to the control tower coordinate system.

OpenGL Mini-project Progress

Try moving the solid cube in Tutorial 1 around and changing its shape and sizes by
the using the commands you learnt.

If you translate the cube by a slightly larger value, you may see it no more. Why?

Up

North

East

Z

Y

X

(0,0,0)

Control Tower