Platform: Windows
Language: VS C++
API: OpenGL
Here is the scene that we set up to use for your
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs0A0kSJjfZP45rYtyp5JRAg57HgPRkZRHZ2VY9q4yhEINuQyFuXRBPAuBQqpqOP57sySnS6rQhWtzj1VyzoMNLwbquhO6_t3a4RIr7oo0hjO_SsMnnj3jZkbjwEl43TR5aN72m2pqo6nO/s320/ckpt1_1.jpg)
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.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5ghyC_sPHEUKXPEnIlion1JpcV7SmZaoqE-ZXTHwz8uByDOybGL2J9cVbc_3cRSf4CWit-4msURTzaQrWb1gA-BNGuFF6YhcHOjZoK624HQDD6TtKDlgo3B80fiQpMxt89clK0Hn6ggDz/s400/ckpt1_2.jpg)
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
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpT5Y1tp-odSpAAYb0TuZArk8BqhgMvUbgcnHDPWo7ylbEQgGD043MIEVNHNVdhWgKa33TRD8FMGzrybmliLOoXp7I7qcuXnSCA3S7yJXJoAcTwAYKVnN0lIfmnnNMsL85Ftys6XtBMjfJ/s400/turner-small.jpg)
-MT