CSE4020 Computer Graphics, Lab Assignment 8

$30.00

Category: Tags: , , , , You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (4 votes)

1. Write down a Python program to draw a transformed triangle in a 3D space.
A. Set the window title to your student ID and the window size to (480,480).
B. Use the following code snippet:C. If you press or repeat a key, the triangle should be transformed as shown in the Table.
Note that key 1 and 3 are already implemented in the above code snippet.
Key Transformation
Q Translate by -0.1 in x direction w.r.t global coordinate
E Translate by 0.1 in x direction w.r.t global coordinate
A Rotate about y axis by -10 degrees w.r.t local coordinate
D Rotate about y axis by +10 degrees w.r.t local coordinate
W Rotate about x axis by -10 degrees w.r.t local coordinate
S Rotate about x axis by +10 degrees w.r.t local coordinate1 Rotate camera -10 degree
3 Rotate camera 10 degree
D. Transformations should be accumulated (composed with previous one).
E. Files to submit: A Python source file (Name the file whatever you want (in English).
Extension should be .py)
2. Write down a Python program to draw a hierarchical model of boxes.
A. Set the window title to your student ID and the window size to (480,480).
B. Start from the following code skeleton.C. Add a green arm at the end of the red arm, and rotate the green arm about its local
z axis.
i. Render the green arm using drawBox().
D. Also render local frames of the blue base, red arm, green arm using drawFrame().
E. Expected result: Uploaded LabAssignment8-2.mp4
F. Files to submit: A Python source file (Name the file whatever you want (in English).
Extension should be .py)