Computer Graphics, Lab Assignment 2
+ 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 down a Python program to:
- Create a 1d array M with values ranging from 2 to 26 and print M.
- Reshape M as a 55 matrix and print M.
- Set the value of inner elements of the matrix M to 0 and print M.
- Assign M2 to the M and print M.
- Lets call the first row of the matrix M a vector v. Calculate the magnitude of the vector v and print it.
- Hint:
- Hint: Use np.sqrt()
- Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py)
Expected output:
- Write down a Python program to draw a regular 12-sided polygon (dodecagon, 12). A.Set the window title to your student ID and the window size to (480,480).
- Use np.linspace() (or np.arrange()), np.cos(), np.sin() to compute the positions of vertices.
- Do not hardcode the position of each vertex.
- The 12 vertices should be specified counterclockwise starting from the vertex on the x-axis.
- (Hint)
- If the keys 1, 2, 3, 9, 0 are entered, the primitive type should be changed.
- Hint: Use a global variable to store the primitive type
| Key | Primitive Type |
| 1 | GL_POINTS |
| 2 | GL_LINES |
| 3 | GL_LINE_STRIP |
| 4 | GL_LINE_LOOP |
| 5 | GL_TRIANGLES |
| 6 | GL_TRIANGLE_STRIP |
| 7 | GL_TRIANGLE_FAN |
| 8 | GL_QUADS |
| 9 | GL_QUAD_STRIP |
| 10 | GL_POLYGON |
- Files to submit: A Python source file (Name the file whatever you want (in English). Extension should be .py) B.Expected result:

![[Solved] Computer Graphics- Lab Assignment 2](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] Computer Graphics, Lab Assignment 9](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.