Computer Graphics, Lab Assignment 6
+ LabAssignment2/
+ 1/
- py
+ 2/
- py
+ 3/
- py
- The submission time is determined not when the commit is made but when the git push is made.
- Write your own myLookAt() and myOrtho() functions (of the following form) that behaves exactly same as gluLookAt() and glOrtho().
def myLookAt(eye, at, up): # eye, at, up are 1D numpy array of length 3 def myOrtho(left, right, bottom, top, zNear, zFar):
- Set the window title to your student ID and the window size to (480,480).
- Code skeleton
- Find code for drawFrame(), drawCubeArray() from 6-Viewing,Projection
- DO NOT use gluLookAt() inside myLookAt() and glOrtho() inside myOrtho()!
- Your program should render the following scene:
- Hint:
- Everything you need to write code is in 6-Viewing,Projection
- l2 norm of v : ||v|| = np.sqrt( np.dot(v, v) )
- a x b (cross product) : np.cross(a, b)
- a b (inner product) : np.dot(a, b) or a@b
- Use glMultMatrixf() to multiply your projection matrix and viewing matrix to the current transformation matrix.
- Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py)
- As mentioned in the lecture, moving camera and moving world are two equivalent operations. Based on the following figure, replace the gluLookAt call() in the following code with two 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()
|
- Set the window title to your student ID and the window size to (480,480).
- Find code for drawFrame(), drawCubeArray() from 5-RenderingPipeline slides.
- Your program should render the following scene:
- Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py)
Reviews
There are no reviews yet.