Starting from:

$25

Computer Graphics-Assignment 2 Obj Viewer Solved

1.     Implement your own obj file viewer. The loaded mesh should be rendered with multiple light sources.

A.     You have to implement all requirements in a single program. This assignment DOES NOT require each requirement to be a separate program

B.      The window size doesn't need to be (480, 480). Use the larger window that is enough to

see the details of the viewer.

 

2.     Requirements 

A. Manipulate the camera in the same way as in ClassAssignment1 using your 

ClassAssignment1 code  

               i.       Also draw the reference grid plane.

 

B. Load an obj file and render it 

i.           Open an obj file by drag-and-drop to your obj viewer window

1.     Google glfwSetDropCallback to see how to do it

2.     The viewer should render only one obj file at a time. If an obj file B is drag-anddropped to the viewer while it is rendering another obj file A, the viewer should

only render the new obj file B.

3.     This feature is essential for scoring your assignment, so if not implemented, 

you won’t get any score for “Load an obj file and render it  

ii.          Read the obj file and display the mesh only using vertex positions, vertex normals, faces information  

1.     Ignore texture coordinate, material, group, shading information. In other words,

ignore vt, mtllib, usemtl, o, s tags.

2.     Use glDrawArrays() or glDrawElements() to render triangle meshes.

A. DO NOT use glVertex*() & glNormal*(). If you draw meshes using glVertex*()

& glNormal*(),.

iii.         Toggle wireframe / solid mode by pressing Z key (similar to pressing Z key in Blender)

iv.         When open an obj file, print out the following information of the obj file to stdout (console)  

1.     File name

2.     Total number of faces

3.     Number of faces with 3 vertices

4.     Number of faces with 4 vertices

5.     Number of faces with more than 4 vertices

 

C. Lighting 

i.          Use multiple light sources (not a single light) to better visualize the mesh  

ii.         Choose the number of light sources, light source types, light colors, material colors as you want.

More products