Tuesday, December 9, 2008

RayTracer - Checkpoint 1 - Setting up the scene

Platform: Windows
Language: VS C++
API: OpenGL

Here is the scene that we set up to use for your raytracer:


















I used spotlight to luminated the scence, however, I couldn't get the shininess and the flare on the spheres. So I decided to add the material properties to the spheres. I added shininess, ambient, and specular to both of the sphere.
Here is the configuration for the scene:

Each sphere has a radius of 0.3
glutSolidSphere(0.30, 50.0, 50.0);
The pink sphere (larger one) is offset from origin by 0.05x, 0.74y, and -1.1z.
The purple sphere (smaller one) is offset from origin by -0.4x, 0.44y, and -1.6z.
The camera positions:
Near plane: 75
Far plane: 800
Eye: 0.0, 0.9, 0.2
Center: 0.05, 0.8, -1.0
Up: 0.0, 1.0, 0.0
gluPerspective(75, 1, 1, 800);
gluLookAt(0.0, 0.9, 0.2, 0.05, 0.8, -1.0, 0.0, 1.0, 0.0);


Size of the floor:

glVertex3f(-1.40, 0.0, -5.0);
glVertex3f(-1.40, 0.0, 5.0);
glVertex3f(1.40, 0.0, 5.0);
glVertex3f(1.40, 0.0, -5.0);
and offset -0.4 in x dir from the origin



The light source is a spot light:
Position: 0.15, 1.4, 0.6
Direction: -0.03, -0.35, -1.0
Spot exponent: 50
Spot cutoff: 95
Constant attenuation: 1
Linear Attenuation: 0
Quadratic attenuation: 0
I also added the shininess of 100
and spec of: 1.0, 1.0, 1.0, 0.0


OUR GOAL: Toreproduce the classic ray traced image from Turner Whitted's 1980 paper




-MT

No comments: