Modelling-Viewing Pipeline - Viewing

Deadline: October 6, 23:59:59 IST

Overview

This is the second part of a two part assignment on exploring the modelling-viewing pipeline. This part deals with viewing. You will simulate the rendering of the models that you made in assignment 1.

Preparation

  1. The assignment is to be maintained and submitted via github.com.
  2. Make sure you have a github.com account and have access to it before proceeding.
  3. You must select the same teams as in Assignment 1 to begin this assignment repository.
  4. Read these instructions about how to get started with assignments on github.
  5. Click on the assignment invitation link sent on the mailing list to begin.

To Do :

  1. Create a scene file called myscene.scn. This will be a ASCII text file in the following format:

     #Model file details followed by modelling transformations
     < Name of first model .raw file >
     < Sx Sy Sz >
     < Rx Ry Rz >
     < Tx Ty Tz >
    
     < Name of second model .raw file >
     < Sx Sy Sz >
     < Rx Ry Rz >
     < Tx Ty Tz >
    
     #VCS Setup
     #In World coordinates specify
     < Ex Ey Ez >
     < Lx Ly Lz >
     < Ux Uy Uz >
    
     #Frustum Size
     #In View coodinates speficy, wrt the eye
     < L, R, T, B >
     < N, F >
    
  2. The first section in the scene file above will give the names of the two files containing the model that you made earlier. After each filename give the scaling, rotation (angles in degrees) and translation parameters that situate this model in the WCS. Note the the line starting with a # is a comment and need not be present in your scene file, or if it is present, it has to be ignored.

  3. The next section gives, in WCS, coordinates of the Eye and the LookAt point, and the unit Up Vector. The section after this gives, in VCS, the size of the image on the near plane with L, R, T, B being the left, right, top and bottom dimensions measured from the eye on the near plane. N and F give the distance to the near and far planes from the eye - they should be positive numbers.

  4. To start with, parse the scene file and load all the models. Draw the frustum in WCS with lines, draw a eye as a point and draw all the models after applying all the modelling transformations to them. The part of the frustum between the near and far planes must be drawn in cyan, the projectors from the near plane to the eye in magenta, the eye in red, and the objects in their respective colours. The grid can be drawn but have the option to hide it with a keypress if required.

  5. All models must be in separate VAOs, and the frustum must be in another VAO. You can use as many VBOs inside the VAOs as you want.

  6. You will define keys 1, 2, 3 and 4 to move from the WCS to VCS (1), from the VCS to CCS (2), from CCS to NDCS (3), from NDCS to DCS (4). Pressing 0 at any stage should reset everything back to the WCS.

  7. For each one of these you have to construct the matrix manually, as explained in class. You can use glm::mat4 to store the matrix and glm::vec4 for storing the vertices, GLM or GLSL can be used for multiplying matrices with vertices to proceed through various stages of the pipeline. No other GLM function is to be used as a part of the simulation. You can also use GLM functions for dot products, cross products and normalizing vectors.

  8. The simulation is to be visualized under a second orthographic projection - glm can be used to set this up in the usual manner and use of glm::ortho and glm::lookat is allowed for this, and only this.

  9. You can have the keys that allowed you to rotate the entire scene in the previous assignment, still active if you want to visualize the simulation better, from other view points.

  10. A bonus of upto 20 marks will be awarded if clipping is implemented in 3D in CCS, or in 2D in DCS. A clipping algortihm of your choice can be implemented. The bonus marks will be awarded only if the rest of the assignment is complete, so please complete the regular assignment before attempting the bonus.

  11. Write a pdf report explaining the design of your code and how you implemented the above mentioned features. Also include rendered screenshots of every stage of your simulated pipeline in your report. Name this report file submit.pdf. Make sure you include the names of both members of your group in the report. Put the report in a doc folder in the assignment folder tree.

  12. Make sure all your sources (both .cpp and .hpp) go into a src folder, the compiled binary goes into a bin folder. Also ensure that you have a top level Makefile present that generates the executable binary in bin folder on typing make. The executable binary must be called a2view.

  13. Also, add a clean target to the Makefile that cleans all files generated during compilation, including the binary and temporary files, if any.

  14. The vertex and fragment shaders that you write must be stored in the src folder as well.

  15. The scene file must be saved in the data folder.

  16. At the time of submission make sure your repository only contains the src, doc and data folders, with all the sources in the src folder, the report in the doc folder, the models in the data folder. In addition there should be the Makefile and a README in the top level folder. There should be no other file in the repository.

Do NOT do the following:

  1. Write untidy or unorganized code. This will be penalized.
  2. Submit a repository that does not conform to the expected structure or has extra files.

Marking

  1. Implementing the scene file parsing correctly : 50 marks
  2. Visualizing all the models and frustum in WCS correctly, including multiple VAOs: 50+50 marks
  3. WCS to VCS, Reset to WCS : 50 marks
  4. VCS to CCS : 50 marks
  5. CCS to NDCS : 50 marks
  6. NDCS to DCS : 50 marks
  7. Report : 30 marks
  8. Correct repository structure: 20 marks
  9. Bonus Clipping in 2D or 3D : 50 marks
  10. Total: 400+50 marks
  11. Deductions: Inconsistently written code: 10 marks
  12. Deductions: Submitting an unclean archive: 20 marks.

Important Note

Please do not put your solution code and report anywhere public. It should not be available online.

To Submit

  1. Regularly check-in the code into your teams' github repository.
  2. The last checkin before the deadline will be considered for marking.
  3. Modify the README.md file in the repository root folder stating the names and roll numbers of your partner for the assignment, and a declaration in your own words that the assignment is your own work and that you have not copied it from anywhere. Also cite any sources that you may have used to complete it.
Previous
Next