[WIP] Add reflective parameter into material

This commit is contained in:
NADAL Jean-Baptiste
2024-03-05 17:01:38 +01:00
parent 17a75a841d
commit 41ea86d3ec
24 changed files with 184 additions and 91 deletions

View File

@@ -50,7 +50,7 @@ int shadow_sphere(uint8_t a_canvas_pixels, double a_wall_size, uint8_t a_wall_z)
Tuple the_ray_origin = Tuple::Point(0, 0, -5);
double the_pixel_size = a_wall_size / a_canvas_pixels;
double the_half = a_wall_size / 2;
double the_half = a_wall_size / 2;
double the_world_x, the_world_y;
// For each row of pixels in the canvas
@@ -70,7 +70,7 @@ int shadow_sphere(uint8_t a_canvas_pixels, double a_wall_size, uint8_t a_wall_z)
the_position -= the_ray_origin;
Ray the_ray(the_ray_origin, the_position.normalize());
auto the_xs = the_shape.intersect(the_ray);
auto the_xs = the_shape.intersect(the_ray);
auto the_intersec = the_xs.hit();
if (the_intersec.is_defined())
{
@@ -94,8 +94,8 @@ int main(void)
printf("Chapter 05 example.\n");
the_start = chrono::high_resolution_clock::now();
the_ret = shadow_sphere(kImageSize, kWallSize, kWallZ);
the_end = chrono::high_resolution_clock::now();
the_ret = shadow_sphere(kImageSize, kWallSize, kWallZ);
the_end = chrono::high_resolution_clock::now();
chrono::duration<double> the_elapsed_time = the_end - the_start;
printf("Execution Time: %f secondes\n", the_elapsed_time.count());