CS计算机代考程序代写 EE5808 Assignment 2 (Total marks = 100)

EE5808 Assignment 2 (Total marks = 100)
Qn 1 (20 marks)
a) What is the key difference between perspective and parallel projection? b) What is the key difference between cavalier and cabinet projection?
c) Given the following OpenGL command:
glOrtho(-2, 2, -2, 2, -2, 2);
(5 marks) (5 marks)
What is the equation of the view plane? What coordinates is the equation expressed in?
(5 marks)
d) A camera is positioned at (100, 100, 100). It is pointing at (0, 100, 0). The view up vector is (0, 0, 1). Write an OpenGL command that defines the camera. (5 marks)
Qn 2 (30 marks)
The figure below shows a hierarchical object with three parts and its DAG. 𝑍𝑍 is pointing out of
the paper. There is no offset in 𝑍𝑍.
Part 1 DAG
Part 2
Part 3
Part 3
Y Part 2
X30o Y
X 30o
Part 1 Y
X 2
10
Part 1 is a cylinder with radius 2 and height 10. It has been implemented in a function Part ( ). Part 2 is Part 1 scaled down by 0.5 in the 𝑋𝑋 and 𝑌𝑌 direction with no scaling in the Z direction. Part 2 is also rotated (300) and translated as shown. Part 3 is rotated (300) and translated with respect to Part 2 as shown.
a) Derive the 4 x 4 homogeneous transformation 𝑀𝑀2←3 . 1
(5 marks)

b) Derive the 4 x 4 homogeneous transformation 𝑀𝑀1←2.
c) Hence write an OpenGL program for the hierarchical object.
(5 marks) (10 marks)
(10 marks)
d) If the object is to have the following motion:
– Part 3 rotated about its Y axis by 45𝑜𝑜
– Part 1 translated along its X axis by 10 unit
Add code to your program to realize the motion. Underline the added code.
Qn 3 (50 marks)
a)
b)
c)
Given the following OpenGL command
gluLookAt (0, 100, -100, 0, 0, 0, 0, 1, 0);
Derive the 4 × 4 homogeneous transformation 𝑀𝑀𝑉𝑉𝑉𝑉←𝑊𝑊𝑉𝑉. Evaluate the inverse.
(15 marks)
The projection vector of a Cavalier projection is (1,1, 𝑉𝑉𝑝𝑝𝑝𝑝 ) and 𝑉𝑉𝑝𝑝𝑝𝑝 > 0. Let the view plane be 𝑍𝑍 = −5. Derive the 4 × 4 projection matrix. The third row of the matrix should record the
original 𝑍𝑍 value before projection.
In the following figure, 𝑌𝑌 axis is pointing out of paper. Functions Part_1 ( ) and Part_2 ( )
have been written. Part 3 is Part 2 reflected about the Z axis of Part 1.
Part 2 𝛼𝛼 Z
XX
60
(10 marks)
Part 3
Part 1 Z
100
Fig. 2
2

Angle 𝛼𝛼 = 30𝑜𝑜
i) Derive the 4 x 4 homogeneous transformation 𝑀𝑀𝑃𝑃1←𝑃𝑃2.
(5 marks) (10 marks)
(10 marks)
ii) Write an OpenGL function object ( ) for the object. iii) Suppose
– Part 2 rotates about its own axis X by 15𝑜𝑜. Note that Part 3 should rotate symmetrically.
– The whole object translates by (10, 10, 10).
Add code to your function for the motion. Underline your code.
— END —
3