Published using Google Docs
Lab 1 document
Updated automatically every 5 minutes

Lab 1 document

Qiushuo Wang

1.Project component:

main.cpp   --- main function, OpenGL mainloop(glut, glfw one not quite work)

classes:

PolyModel----load model, restore geometry information, calculate face normal, draw model

GTranform----The class that perform the geometry transformation, create and store the transformation matrix, temporarily restore, realise backface culling

Mat4,Vec2,Vec3-----Implementation of matrices and vectors of different dimensions(not fully implemented but suits usage in this project)

2.Logic Sequence

  1. Initiate camera(possible oblique camera), set all basic variables of the camera 2)Load model, load vertices and polygon of vertices indices, compute face normal

     3)  Initiate transformation matrix with Identity Matrix,calculate the back face culling and restore a boolean vector into the model class

    4)        Load vertex matrix(vector of vectors) into transformation class as 4d matrix,

create transformation matrices sequentially and multiply them with to the transformation matrix;

    5)        Preform transformation by multiply the transformation matrix with the vertex matrices. Downcast the 4d matrix to 3d and 2d and restore back into the model

   6)        Load transformed matrix into the vertex buffer and draw the lines using OpenGL