This is an assignment written in C++ for Computer Graphics class.
The program is based on provided code and the following are our specific tasks and results I had.
1. Ray Tracing a Parallelogram
Set up the parameters of the parallelogram (position of the corner, plus one vector for each side of the parallelogram);
Check if a ray intersects with an arbitrary parallelogram;
Calculate the intersection between the ray and the parallelogram using the function defined above.
Compute the normal of that intersection point.
2. Ray Tracing with Perspective Projection
Modify the ray equation for perspective projection.
Compare the difference in the result for a sphere, for a parallelogram (you can also create a scene with multiple objects).
Result: The left one is the Perspective parallelogram and the right one is the Orthographic one. The light source come from the left top.
Implement the basic shading components discussed in class: ambient, specular and diffuse.
Add RGB components instead of a greyscale one.
Result: a ray-traced sphere with RGBA