Description
1. Write down a Python program to draw transformed triangles and its local frame in a 3D space. A. Set the window title to your student ID and the window size to (480,480). B. Use the following drawFrame() and drawTriangle() to draw the frame and triangle: + 2021_ITE0000_2019000001 + LabAssignment5/ + 1/ – 1.py + 2/ – 2.py + 3/ – 3.py C. First draw an untransformed white triangle and a global frame. D. Then draw a transformed blue triangle and its local frame. The triangle should be first rotated by 30 degrees and then translated by (0.6, 0, 0) w.r.t. the global frame. E. Then draw a transformed red triangle and its local frame. The triangle should be first translated by (0.6, 0, 0) and then rotated by 30 degrees w.r.t the global frame. F. Expected result: i. G. Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py) 2. $VPHQWLRQHGLQWKHOHFWXUHęPRYLQJFDPHUDĚDQGęPRYLQJZRUOGĚDUHWZRHTXLYDOHQWRSHUDWLRQV Based on the following figure, replace the gluLookAt call() in the following code with two def drawFrame(): glBegin(GL_LINES) glColor3ub(255, 0, 0) glVertex2fv(np.array([0.,0.])) glVertex2fv(np.array([1.,0.])) glColor3ub(0, 255, 0) glVertex2fv(np.array([0.,0.])) glVertex2fv(np.array([0.,1.])) glEnd() def drawTriangle(): glBegin(GL_TRIANGLES) glVertex2fv(np.array([0.,.5])) glVertex2fv(np.array([0.,0.])) glVertex2fv(np.array([.5,0.])) glEnd() replace glRotatef() calls and one glTranslatef() call and complete the program.



