Last weekend I have finished assignment_2.
This assignment adds ambient & normal shading to the raycast program of assignment 1.
Now 3D objects looks much more like 3D objects.
And, here is my code.
MIT_OCW_6.837_ASSIGNMENT2.Tim.tar
Now the objects looks like this. (3 graphics for each scene. From left to right: real, depth, normal[red:x, green:y, blue:z])
Figure 1. A Sphere with normal shading
Figure 2. A Sphere with both normal shading and ambient
Figure 3. Perspective Camera
Figure 4. Infinite Plane Object
Figure 5. Triangle
Figure 6. Triangle Mesh
Figure 7. Rotated Sphere
Figure 8. Transformed Sphere
Figure 9. Complex Triangle Mesh (n = 200)
Figure 10. More Complex Triangle Mesh (n = 1000)
Figure 11. Axies