This study source was downloaded by 100000859819779 from CourseHero.com on 02-04-2023 14:10:57 GMT -06:00https://www.coursehero.com/file/186109896/Cami%C3%B1a-Francis-Computer-Graphics-Programming-06-Laboratory-Exercise-1docx/ Camia, Rey Francis R.IT701PComputer Graphics Programming CODE: import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * def add_texture():image = pygame.image.load('photo-1536152470836-b943b246224c.jpg')data = pygame.image.tostring(image, 'RGBA')texID = glGenTextures(1)glBindTexture(GL_TEXTURE_2D, texID)glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.get_width(), image.get_height(), 0,GL_RGBA, GL_UNSIGNED_BYTE, data)glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)glEnable(GL_TEXTURE_2Ddef main(): pygame.init(); display = (900, 700) pygame.display.set_mode(display, DOUBLEBUF|OPENGL) pygame.display.set_caption("Camina, Francis - 06 Lab 1") gluPerspective(45, (display[0]/display[1]), 0.1, 50.0) glTranslatef(0.0, 0.0, -5) glRotatef(360, 1, 1, 1)This study source was downloaded by 100000859819779 from CourseHero.com on 02-04-2023 14:10:57 GMT -06:00https://www.coursehero.com/file/186109896/Cami%C3%B1a-Francis-Computer-Graphics-Programming-06-Laboratory-Exercise-1docx/ while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() quit() glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) draw_object() glRotatef(1, 1, 1, 1) pygame.display.flip() pygame.time.wait(20) def draw_object(): glPushMatrix() glColor3f(0,1,1) glScalef(1,1,1) draw_cube() glPopMatrix() glPushMatrix() glColor3f(1,1,0) glScalef(.75,.75,.75) draw_cube() glPopMatrix() glPushMatrix() glColor3f(1,1,1) glScalef(.50,.50,.50) draw_cube() glPopMatrix() glPushMatrix() glColor3f(0,0,1) glScalef(.25,.25,.25) draw_cube() glPopMatrix() def draw_cube(): glBegin(GL_TRIANGLES)This study source was downloaded by 100000859819779 from CourseHero.com on 02-04-2023 14:10:57 GMT -06:00https://www.coursehero.com/file/186109896/Cami%C3%B1a-Francis-Computer-Graphics-Programming-06-Laboratory-Exercise-1docx/ glVertex3f(1,1,1); glVertex3f(1,-1,1); glVertex3f(1,-1,1); glVertex3f(1,-1,1); glVertex3f(1,1,1); glVertex3f(-1,-1,1); glVertex3f(-1,-1,1); glVertex3f(-1,1,1); glVertex3f(1,1,1); glVertex3f(1,1,1); glVertex3f(1,-1,-1); glVertex3f(-1,-1,-1); glVertex3f(1,-1,-1); glVertex3f(-1,-1,-1); glVertex3f(1,1,-1); glVertex3f(-1,-1,-1); glVertex3f(-1,1,-1); glVertex3f(1,1,-1); glVertex3f(1,1,1); glVertex3f(1,1,-1); glVertex3f(1,1,-1); glVertex3f(1,1,-1); glVertex3f(1,-1,-1); glVertex3f(1,-1,1); glVertex3f(1,-1,-1); glVertex3f(1,-1,1); glVertex3f(1,1,1); glVertex3f(1,1,1); glVertex3f(1,-1,-1); glVertex3f(-1,-1,-1); glVertex3f(1,-1,-1); glVertex3f(-1,-1,-1); glVertex3f(1,-1,1);This study source was downloaded by 100000859819779 from CourseHero.com on 02-04-2023 14:10:57 GMT -06:00https://www.coursehero.com/file/186109896/Cami%C3%B1a-Francis-Computer-Graphics-Programming-06-Laboratory-Exercise-1docx/ glVertex3f(-1,-1,-1); glVertex3f(-1,-1,1);