James Bigler: CS6620 Homework 2
Add diffuse shading, shadows, and triangles to your raytracer.
All images(400x400) were created using a jittered sampling (16).
The scene consists of
- sphere 0 1 15 2.5 0.5 1.0 1.0
- sphere 0 0 11 1.5 0 0.5 0.5
- sphere 0 0 10 1 0 0 1
- tri_ellipsoid 0 1 10 0.5 0.5 0.5 20 40 1 0 0
- sphere 1 1.3 8 0.5 0.5 1 8
A tri_ellipsoid is an object which is constructed opon parsing that is
the triangle approximation to the grid orientated ellipsoid. The form
is cx cy cz rx ry rz num_latitudinal_divisions
num_longitudinal_divisions R G B. The sphere approximated here has
1440 triangles.
I'm using double siding lighting. That means that if the normal
points away from the light that you reverse the normal. The effect is
appearant when in these images where the spheres are lit from both
sides. Notice that the red sphere does not show this behavior,
because it is made up of triangles which occlude the other side making
it always in shadow!
-eye 0 0 0 -lookat 0 0 10 -up 0 1 0 -fov 40
-eye 0 0 0 -lookat 0 0 10 -up 1 0 0 -fov 40
-eye -10 5 0 -lookat 0 0 10 -up 0 1 0 -fov 40
-eye -4 2 10.5 -lookat 0 1 10 -up 0 1 0 -fov 45
eye -4 2 10.5 -lookat 0 1 10 -up 0 1 1 -fov 45
Galleon object 4698 triangles
// this is sample code