Description
Write down a Python program to draw transformed triangles and its local frame in a 3D space. A. Set the window title and the window size to (480,480).
-
- Use the following drawFrame() and drawTriangle() to draw the frame and triangle:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- First draw an untransformed white triangle and a global frame.
- 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.
- 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:
- $VPHQWLRQHGLQWKHOHFWXUHęPRYLQJFDPHUDĚDQGęPRYLQJZRUOGĚDUHWZRHTXLYDOHQWRSHUDWLRQV Based on the following figure, replace the gluLookAt call() in the following code with two replace glRotatef() calls and one glTranslatef() call and complete the program.
gluPerspective(45, 1, 1,10) # Replace this call with two glRotatef() calls and one glTranslatef() call gluLookAt(3,3,3, 0,0,0, 0,1,0)
drawFrame()
glColor3ub(255, 255, 255) drawCubeArray() |
|||||||||||||||||||||||||||||
- Set the window titleand the window size to (480,480).
- Find code for drawFrame(), drawCubeArray() from 5-RenderingPipeline, viewing&projection1 slides.
- Your program should render the following scene:




