3D Renderer (C++)

The program started off with “Vertex” and “Matrix” classes
which held the instructions to multiply them together; this is the basis of
transforming and viewing the vertices on the screen. Once we had these, we
could implement the full viewing pipeline, using perspective projection. And
after this we could visually display these points on screen.

Once I had the mathematical stuff down I was able to work on
lighting and graphics. I used faceted shading to begin with, which meant I
could perfect the lighting, before moving on to gouraud shading. The program features
implementation of Ambient, Directional and Point Lights. The lighting is
calculated using the Phong Reflection model. I used windows GDI+ graphics
library to fill the polygons to begin with, and later on implemented my own
“FillPolygon” routine.
Once the lighting was finished, I could work on a better
shading option, for this I used Gouraud shading. This stores a colour at each
Vertex and then uses interpolation to work out the colours when it fills the
triangle. The result makes for a much better model.





Comments
Post a Comment