write a python program

profilemohsinwaheed31
labCG.rar

lab CG/assignment/1.JPG

lab CG/assignment/10.JPG

lab CG/assignment/2.JPG

lab CG/assignment/3.JPG

lab CG/assignment/4.JPG

lab CG/assignment/5.JPG

lab CG/assignment/6.JPG

lab CG/assignment/7.JPG

lab CG/assignment/8.JPG

lab CG/assignment/9.JPG

lab CG/assignment/supplementary.zip

control-points.txt

100,200 150,300 200,200 250,300 300,200 350,300 400,200 450,300

CSE4CG-2020-A1-Marking-Sheet.pdf

CSE4CG - Semester 2, 2020 Assignment 1 – Marking Sheet

Student Name: _______________________________ Marking Date: ____________

Student No.: _______________________________ Total Points: _______/100

The coordinator moves control-points.txt and pyramid-params.txt to the folder where program files are before marking. If the student has any doubt the mark, he or she needs to contact the coordinator for review during the marking session. The coordinator will NOT accept any request of mark review after the marking session. In Task 1, 2 and 3, if the Python program does not compile or run, the points given for the task will NOT exceed 10.

Task 1: one.py (25 Points) Mark Max 1 Program is reasonably written in good style and with necessary comments. 5 2 Program compiles and runs. 5 3 Window is drawn in correct size, position and title. 3 4 Curve is drawn in correct shape and color. 4 5 Axes are drawn in correct shape and color. 4 6 Curve is animated correctly. 4

Task 2: two.py (30 Points) 1 Program is reasonably written in good style and with necessary comments. 5 2 Program compiles and runs. 5 3 Window is drawn in correct size, position and title. 3 4 Control points are correctly loaded from the text file. 4 5 Control points are drawn in correct size and color. 6 6 Curve is drawn in correct shape and color. 7

Task 3: three.py (40 Points) 1 Program is reasonably written in good style and with necessary comments. 5 2 Program compiles and runs. 5 3 Window is drawn in correct size, position and title. 3 4 Parameters are correctly loaded from the text file. 3 5 Pyramid is drawn in correct shape. 5 6 Faces are randomly colored, and base is in white. 4 7 Pressing the key R leads the correct action. 3 8 Pressing the key H leads the correct action. 3 9 Pressing the key X leads the correct action. 3 10 Pressing the key Y leads the correct action. 3 11 Pressing the key Z leads the correct action. 3

Task 4: four.pdf (5 Points) 1 Report addresses all required points. 5

Total 100

pyramid-params.txt

0.0,0.5,-1.0,0.5,0.1

lab CG/lab 1/1.JPG

lab CG/lab 1/10.JPG

lab CG/lab 1/11.JPG

lab CG/lab 1/12.JPG

lab CG/lab 1/13.JPG

lab CG/lab 1/14.JPG

lab CG/lab 1/15.JPG

lab CG/lab 1/16.JPG

lab CG/lab 1/17.JPG

lab CG/lab 1/18.JPG

lab CG/lab 1/19.JPG

lab CG/lab 1/2.JPG

lab CG/lab 1/20.JPG

lab CG/lab 1/21.JPG

lab CG/lab 1/22.JPG

lab CG/lab 1/3.JPG

lab CG/lab 1/4.JPG

lab CG/lab 1/5.JPG

lab CG/lab 1/6.JPG

lab CG/lab 1/7.JPG

lab CG/lab 1/8.JPG

lab CG/lab 1/9.JPG

lab CG/lab 1/L1-Q1.py

from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import math def display(): glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() cx = 250 cy = 250 r = 100 glBegin(GL_TRIANGLE_FAN) glColor3f(1.0, 0.0, 0.0) glVertex2f(cx, cx) for i in range(361): rad = i / 180 * math.pi x = cx + math.cos(rad) * 100 y = cy + math.sin(rad) * 100 glColor3f(abs(i - 180) / 360, 0.0, 0.0) glVertex2f(x, y) glEnd() glutSwapBuffers() def idle(): display() def initRendering(): glEnable(GL_DEPTH_TEST) # glEnable(GL_LIGHTING) # glEnable(GL_LIGHT0) def reshape(w, h): glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, 0.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() w, h = 500, 500 u, v = 100, 100 glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize(w, h) glutInitWindowPosition(u, v) glutCreateWindow("Lab 01") initRendering() glutReshapeFunc(reshape, w, h) glutDisplayFunc(display) glutIdleFunc(idle) glutMainLoop()

lab CG/lab 1/L1-Q2.py

from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import math def display(): glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() glBegin(GL_LINE_STRIP) glColor3f(255 / 255, 165 / 255, 0.0) cx = 250 cy = 250 x_min = 0 x_max = 200 y_max = 50 for i in range(x_min, x_max + 1): x = cx + i rad = x * 4 / 180 * math.pi y = cy + math.cos(rad) * y_max glVertex2f(x, y) glEnd() glutSwapBuffers() def idle(): display() def initRendering(): glEnable(GL_DEPTH_TEST) # glEnable(GL_LIGHTING) # glEnable(GL_LIGHT0) def reshape(w, h): glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, 0.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() w, h = 500, 500 u, v = 100, 100 glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize(w, h) glutInitWindowPosition(u, v) glutCreateWindow("Lab 01") initRendering() glutReshapeFunc(reshape, w, h) glutDisplayFunc(display) glutIdleFunc(idle) glutMainLoop()

lab CG/lab 2/1.JPG

lab CG/lab 2/10.JPG

lab CG/lab 2/11.JPG

lab CG/lab 2/12.JPG

lab CG/lab 2/13.JPG

lab CG/lab 2/14.JPG

lab CG/lab 2/15.JPG

lab CG/lab 2/16.JPG

lab CG/lab 2/17.JPG

lab CG/lab 2/18.JPG

lab CG/lab 2/19.JPG

lab CG/lab 2/2.JPG

lab CG/lab 2/3.JPG

lab CG/lab 2/4.JPG

lab CG/lab 2/5.JPG

lab CG/lab 2/6.JPG

lab CG/lab 2/7.JPG

lab CG/lab 2/8.JPG

lab CG/lab 2/9.JPG

lab CG/lab 2/L2-Q1.py

from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import math # Support math operations import numpy as np # Support efficient vectors and matrices def pBezierCurve(t, control_points): G = control_points.T B = np.array([ [ 1, -3, 3, -1 ], [ 0, 3, -6, 3 ], [ 0, 0, 3, -3 ], [ 0, 0, 0, 1 ] ]) T = np.array([ [ 1 ], [ t ], [ t * t ], [ t * t * t ] ]) p = np.matmul(G, np.matmul(B, T)) return p def display(): pts = np.array([ [200, 200], [250, 300], [300, 200], [350, 300] ]) n = 100 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() # Draw control points glPointSize(5.0) glColor3f(1.0, 0.0, 0.0) glBegin(GL_POINTS) for i in range(4): glVertex2fv(pts[i]) glEnd() glPointSize(1.0) # Draw cubic Bezier curve glColor3f(1.0, 1.0, 1.0) glBegin(GL_LINE_STRIP) for i in range(n + 1): t = i / n p = pBezierCurve(t, pts) glVertex2fv(p) glEnd() glutSwapBuffers() def idle(): display() def initRendering(): glEnable(GL_DEPTH_TEST) # glEnable(GL_LIGHTING) # glEnable(GL_LIGHT0) def reshape(w, h): glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, 0.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() w, h = 500, 500 u, v = 100, 100 glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize(w, h) glutInitWindowPosition(u, v) glutCreateWindow("Lab 02") initRendering() glutReshapeFunc(reshape, w, h) glutDisplayFunc(display) glutIdleFunc(idle) glutMainLoop()

lab CG/lab 2/L2-Q2.py

from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import math # Support math operations import numpy as np # Support efficient vectors and matrices def pBezierCurve(t, control_points): G = control_points.T B = np.array([ [ 1, -3, 3, -1 ], [ 0, 3, -6, 3 ], [ 0, 0, 3, -3 ], [ 0, 0, 0, 1 ] ]) T = np.array([ [ 1 ], [ t ], [ t * t ], [ t * t * t ] ]) p = np.matmul(G, np.matmul(B, T)) return p def display(): pts = np.array([ [100, 200], [150, 300], [200, 200], [250, 300], [300, 200], [350, 300], [400, 200], [450, 300] ]) c = 8 n = 100 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() # Draw control points glPointSize(5.0) glColor3f(1.0, 0.0, 0.0) glBegin(GL_POINTS) for i in range(c): glVertex2fv(pts[i]) glEnd() glPointSize(1.0) # Draw Bezier Curve glColor3f(1.0, 1.0, 1.0) glBegin(GL_LINE_STRIP) for s in range(int(c/3)): # Divide all control points by 4 cp = pts[s*3:(s+1)*3+1] # Get each subset from pts for i in range(n + 1): # Draw their part t = i / n p = pBezierCurve(t, cp) glVertex2fv(p) glEnd() glutSwapBuffers() def idle(): display() def initRendering(): glEnable(GL_DEPTH_TEST) # glEnable(GL_LIGHTING) # glEnable(GL_LIGHT0) def reshape(w, h): glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, 0.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() w, h = 500, 500 u, v = 100, 100 glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize(w, h) glutInitWindowPosition(u, v) glutCreateWindow("Lab 02") initRendering() glutReshapeFunc(reshape, w, h) glutDisplayFunc(display) glutIdleFunc(idle) glutMainLoop()

lab CG/lab 3/1.JPG

lab CG/lab 3/10.JPG

lab CG/lab 3/11.JPG

lab CG/lab 3/12.JPG

lab CG/lab 3/13.JPG

lab CG/lab 3/14.JPG

lab CG/lab 3/15.JPG

lab CG/lab 3/16.JPG

lab CG/lab 3/17.JPG

lab CG/lab 3/18.JPG

lab CG/lab 3/19.JPG

lab CG/lab 3/2.JPG

lab CG/lab 3/20.JPG

lab CG/lab 3/21.JPG

lab CG/lab 3/22.JPG

lab CG/lab 3/23.JPG

lab CG/lab 3/24.JPG

lab CG/lab 3/25.JPG

lab CG/lab 3/26.JPG

lab CG/lab 3/3.JPG

lab CG/lab 3/4.JPG

lab CG/lab 3/5.JPG

lab CG/lab 3/6.JPG

lab CG/lab 3/7.JPG

lab CG/lab 3/8.JPG

lab CG/lab 3/9.JPG

lab CG/lab 3/L3-Q1.py

from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import math # Support math operations import numpy as np # Support efficient vectors and matrices def pBezierSurface(u, v, G_x, G_y): B = np.array([ [ 1, -3, 3, -1 ], [ 0, 3, -6, 3 ], [ 0, 0, 3, -3 ], [ 0, 0, 0, 1 ] ]) U = np.array([ [ 1 ], [ u ], [ u * u ], [ u * u * u ] ]) V = np.array([ [ 1 ], [ v ], [ v * v ], [ v * v * v ] ]) B_u = np.matmul(B, U).T B_v = np.matmul(B, V) p_x = np.matmul(B_u, np.matmul(G_x, B_v)) p_y = np.matmul(B_u, np.matmul(G_y, B_v)) return np.concatenate((p_x[0], p_y[0])) def display(): control_points = np.array([ [150, 200], # P 1,1 [200, 190], # P 1,2 [250, 200], # P 1,3 [300, 190], # P 1,4 [140, 250], # P 2,1 [210, 240], # P 2,2 [260, 250], # P 2,3 [290, 240], # P 2,4 [150, 300], # P 3,1 [200, 290], # P 3,2 [250, 300], # P 3,3 [300, 290], # P 3,4 [140, 350], # P 4,1 [210, 340], # P 4,2 [260, 350], # P 4,3 [290, 340] # P 4,4 ]) # Control points as a NumPy array n = 10 # Number of intervals for discretizing u, v # Create a 4*4 matrix for each coordinate of the control points G_x = np.zeros((4, 4)) G_y = np.zeros((4, 4)) for i in range(4): for j in range(4): k = i * 4 + j G_x[i][j] = control_points[k][0] G_y[i][j] = control_points[k][1] # Reset glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() # Create a matrix-like list of points P(u, v) glBegin(GL_POINTS) points = [] for i in range(n + 1): u = i / n points_by_u = [] for j in range(n + 1): v = j / n p = pBezierSurface(u, v, G_x, G_y) points_by_u.append(p) glVertex2fv(p) points.append(points_by_u) glEnd() # Draw the surface using quads glBegin(GL_QUADS) for i in range(n): for j in range(n): p1 = points[i][j] p2 = points[i + 1][j] p3 = points[i + 1][j + 1] p4 = points[i][j + 1] glVertex2fv(p1) glVertex2fv(p2) glVertex2fv(p3) glVertex2fv(p4) glEnd() glutSwapBuffers() def idle(): display() def initRendering(): glEnable(GL_DEPTH_TEST) # glEnable(GL_LIGHTING) # glEnable(GL_LIGHT0) def reshape(w, h): glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, 0.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() w, h = 500, 500 u, v = 100, 100 glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize(w, h) glutInitWindowPosition(u, v) glutCreateWindow("Lab 03") initRendering() glutReshapeFunc(reshape, w, h) glutDisplayFunc(display) glutIdleFunc(idle) glutMainLoop()

lab CG/lab 3/L3-Q2.py

from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import math # Support math operations import numpy as np # Support efficient vectors and matrices def pBezierSurface(u, v, G_x, G_y): B = np.array([ [ 1, -3, 3, -1 ], [ 0, 3, -6, 3 ], [ 0, 0, 3, -3 ], [ 0, 0, 0, 1 ] ]) U = np.array([ [ 1 ], [ u ], [ u * u ], [ u * u * u ] ]) V = np.array([ [ 1 ], [ v ], [ v * v ], [ v * v * v ] ]) B_u = np.matmul(B, U).T B_v = np.matmul(B, V) p_x = np.matmul(B_u, np.matmul(G_x, B_v)) p_y = np.matmul(B_u, np.matmul(G_y, B_v)) return np.concatenate((p_x[0], p_y[0])) def display(): control_points = np.array([ [150, 200], # P 1,1 [200, 190], # P 1,2 [250, 200], # P 1,3 [300, 190], # P 1,4 [140, 250], # P 2,1 [210, 240], # P 2,2 [260, 250], # P 2,3 [290, 240], # P 2,4 [150, 300], # P 3,1 [200, 290], # P 3,2 [250, 300], # P 3,3 [300, 290], # P 3,4 [140, 350], # P 4,1 [210, 340], # P 4,2 [260, 350], # P 4,3 [290, 340] # P 4,4 ]) # Control points as a NumPy array n = 10 # Number of intervals for discretizing u, v # Create a 4*4 matrix for each coordinate of the control points G_x = np.zeros((4, 4)) G_y = np.zeros((4, 4)) for i in range(4): for j in range(4): k = i * 4 + j G_x[i][j] = control_points[k][0] G_y[i][j] = control_points[k][1] # Reset glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() # Create a matrix-like list of points P(u, v) glBegin(GL_POINTS) points = [] for i in range(n + 1): u = i / n points_by_u = [] for j in range(n + 1): v = j / n p = pBezierSurface(u, v, G_x, G_y) points_by_u.append(p) glVertex2fv(p) points.append(points_by_u) glEnd() # Draw the surface's skeleton glBegin(GL_LINES) for i in range(n): for j in range(n): p1 = points[i][j] p2 = points[i + 1][j] p3 = points[i + 1][j + 1] p4 = points[i][j + 1] glVertex2fv(p1) glVertex2fv(p2) glVertex2fv(p2) glVertex2fv(p3) glVertex2fv(p3) glVertex2fv(p4) glVertex2fv(p4) glVertex2fv(p1) glEnd() glutSwapBuffers() def idle(): display() def initRendering(): glEnable(GL_DEPTH_TEST) # glEnable(GL_LIGHTING) # glEnable(GL_LIGHT0) def reshape(w, h): glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() glOrtho(0.0, w, 0.0, h, 0.0, 1.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() w, h = 500, 500 u, v = 100, 100 glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize(w, h) glutInitWindowPosition(u, v) glutCreateWindow("Lab 03") initRendering() glutReshapeFunc(reshape, w, h) glutDisplayFunc(display) glutIdleFunc(idle) glutMainLoop()

lab CG/lab 4/1.JPG

lab CG/lab 4/10.JPG

lab CG/lab 4/11.JPG

lab CG/lab 4/12.JPG

lab CG/lab 4/13.JPG

lab CG/lab 4/14.JPG

lab CG/lab 4/15.JPG

lab CG/lab 4/16.JPG

lab CG/lab 4/17.JPG

lab CG/lab 4/2.JPG

lab CG/lab 4/3.JPG

lab CG/lab 4/4.JPG

lab CG/lab 4/5.JPG

lab CG/lab 4/6.JPG

lab CG/lab 4/7.JPG

lab CG/lab 4/8.JPG

lab CG/lab 4/9.JPG

lab CG/lab 4/L4-T3.py

from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import math import numpy as np def display(): global angle vertices = np.array([ [-0.1, -0.1, -0.0], # P0 [0.1, -0.1, -0.0], # P1 [0.1, 0.1, -0.0], # P2 [-0.1, 0.1, -0.0], # P3 [-0.1, -0.1, -0.2], # P4 [0.1, -0.1, -0.2], # P5 [0.1, 0.1, -0.2], # P6 [-0.1, 0.1, -0.2], # P7 ]) faces = np.array([ [0, 1, 2, 3], # Front [4, 5, 6, 7], # Back [3, 2, 6, 7], # Top [0, 1, 5, 4], # Bottom, [4, 0, 3, 7], # Left, [1, 5, 6, 2] # Right ]) # Reset glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() gluLookAt(0.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0) # Move and rotate glTranslatef(0.0, 0.0, -0.5) glRotatef(angle, 0.0, 1.0, 0.0) angle += 0.5 # Draw the cube using lines glBegin(GL_LINES) for i in range(6): face = faces[i] glVertex3fv(vertices[face[0]]) glVertex3fv(vertices[face[1]]) glVertex3fv(vertices[face[1]]) glVertex3fv(vertices[face[2]]) glVertex3fv(vertices[face[2]]) glVertex3fv(vertices[face[3]]) glVertex3fv(vertices[face[3]]) glVertex3fv(vertices[face[0]]) glEnd() glutSwapBuffers() def idle(): display() def initRendering(): glEnable(GL_DEPTH_TEST) # glEnable(GL_LIGHTING) # glEnable(GL_LIGHT0) def reshape(w, h): glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, w / h, 0.01, 100.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() w, h = 500, 500 u, v = 100, 100 angle = 0.0 glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize(w, h) glutInitWindowPosition(u, v) glutCreateWindow("Lab 04") initRendering() glutReshapeFunc(reshape, w, h) glutDisplayFunc(display) glutIdleFunc(idle) glutMainLoop()

lab CG/lab 4/L4-T4.py

from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import math import numpy as np def display(): global move vertices = np.array([ [-0.1, -0.1, -0.0], # P0 [0.1, -0.1, -0.0], # P1 [0.1, 0.1, -0.0], # P2 [-0.1, 0.1, -0.0], # P3 [-0.1, -0.1, -0.2], # P4 [0.1, -0.1, -0.2], # P5 [0.1, 0.1, -0.2], # P6 [-0.1, 0.1, -0.2], # P7 ]) faces = np.array([ [0, 1, 2, 3], # Front [4, 5, 6, 7], # Back [3, 2, 6, 7], # Top [0, 1, 5, 4], # Bottom, [4, 0, 3, 7], # Left, [1, 5, 6, 2] # Right ]) # Reset glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() gluLookAt(0.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0) # Move glTranslatef(move, 0.0, -0.5) move += 0.0001 # Draw the cube using lines glBegin(GL_LINES) for i in range(6): face = faces[i] glVertex3fv(vertices[face[0]]) glVertex3fv(vertices[face[1]]) glVertex3fv(vertices[face[1]]) glVertex3fv(vertices[face[2]]) glVertex3fv(vertices[face[2]]) glVertex3fv(vertices[face[3]]) glVertex3fv(vertices[face[3]]) glVertex3fv(vertices[face[0]]) glEnd() glutSwapBuffers() def idle(): display() def initRendering(): glEnable(GL_DEPTH_TEST) # glEnable(GL_LIGHTING) # glEnable(GL_LIGHT0) def reshape(w, h): glViewport(0, 0, w, h) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, w / h, 0.01, 100.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() w, h = 500, 500 u, v = 100, 100 move = 0.0 glutInit() glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH) glutInitWindowSize(w, h) glutInitWindowPosition(u, v) glutCreateWindow("Lab 04") initRendering() glutReshapeFunc(reshape, w, h) glutDisplayFunc(display) glutIdleFunc(idle) glutMainLoop()

lab CG/lab 5/1.JPG

lab CG/lab 5/10.JPG

lab CG/lab 5/11.JPG

lab CG/lab 5/12.JPG

lab CG/lab 5/13.JPG

lab CG/lab 5/14.JPG

lab CG/lab 5/15.JPG

lab CG/lab 5/16.JPG

lab CG/lab 5/17.JPG

lab CG/lab 5/18.JPG

lab CG/lab 5/19.JPG

lab CG/lab 5/2.JPG

lab CG/lab 5/20.JPG

lab CG/lab 5/21.JPG

lab CG/lab 5/3.JPG

lab CG/lab 5/4.JPG

lab CG/lab 5/5.JPG

lab CG/lab 5/6.JPG

lab CG/lab 5/7.JPG

lab CG/lab 5/8.JPG

lab CG/lab 5/9.JPG