Wednesday, December 8, 2010

Ray Tracer Checkpoint 1: Setting The Scene

I'm currently enrolled in Computer Graphics II at the Rochester Institute of Technology. The primary project this course is to incrementally build a ray tracer renderer. The first milestone of this project is to roughly replicate the following scene in any 3D API.

Figure 1. Turner Whitted's Rendering circa 1980

And here is my simple rendering. NOTE: The intention of this milestone was not to replicate the lighting and tone reproduction of the original, but to refresh oneself in graphics programming and use clues in the image to find the relative positions of the objects in the scene. Below is my rendering.

Figure 2. My fancy rendering

To create this image I used to the following configuration

/** Scene Parameters **/
/* Camera */
GLfloat camera_position[] = {0.0f, 1.0f, -1.0f};
GLfloat camera_lookat[] = {0.0f, 0.0, 10.0f};
GLfloat camera_up[] =  {0.0f, 1.0f, 0.0f};
 
/* Light */
GLfloat light_position[] = {0.0f, 6.0f, 0.4f, 1.0f};
 
/* Floor */
GLfloat floor_n[] =   {0.0f, 1.0f, 1.0f};
GLfloat floor_v0[] =   {5.0f, 0.0f, 10.0f};
GLfloat floor_v1[] =  {-1.5f, 0.0f, 10.0f};
GLfloat floor_v2[] =   {-1.5f, 0.0f, 0.0f};
GLfloat floor_v3[] =  {4.5f, 0.0f, 0.0f};
GLfloat floor_color[] =  {1.0f, 1.0f, 0.0f};
 
/* Transparent Sphere */
GLfloat trans_sphere_position[] = {0.1f, 1.1f, 0.5f};
GLfloat trans_sphere_radius = 0.5f;
GLfloat trans_sphere_color[] = {.7f, .7f, .7f};
 
/* Reflective, Metal Sphere */
GLfloat metal_sphere_position[] = {1.6f, 0.4f, 3.0f};
GLfloat metal_sphere_radius = 1.0f;
GLfloat metal_sphere_color[] = {0.0f, 1.0f, 0.0f};



No comments:

Post a Comment