Helper class for running ray-tracing algorithm. More...
Static Public Member Functions | |
| static void | trace (const scene3d &scene, image *pic) |
| run ray-tracing algorithm given a 3D scene and a picture | |
Static Private Member Functions | |
| static color | throw_ray (const scene3d &scene, const ray &ray_current) |
| throw a ray in the scene along the given ray | |
| static std::pair < intersection_object, bool > | find_inter (const ray &ray_current, const scene3d &scene) |
| find the intersection between a given ray and the first object in the 3D scene | |
| static color | find_intersection_color (const std::pair< intersection_object, bool > &inter, const scene3d &scene) |
| get the color at a given intersection position | |
Helper class for running ray-tracing algorithm.
| std::pair< intersection_object, bool > cpe::ray_tracer::find_inter | ( | const ray & | ray_current, | |
| const scene3d & | scene | |||
| ) | [static, private] |
find the intersection between a given ray and the first object in the 3D scene
References cpe::scene3d::get_material(), cpe::scene3d::get_object(), cpe::object3d::intersect(), and cpe::scene3d::N_object().
Referenced by throw_ray().

| color cpe::ray_tracer::find_intersection_color | ( | const std::pair< intersection_object, bool > & | inter, | |
| const scene3d & | scene | |||
| ) | [static, private] |
get the color at a given intersection position
Referenced by throw_ray().
| color cpe::ray_tracer::throw_ray | ( | const scene3d & | scene, | |
| const ray & | ray_current | |||
| ) | [static, private] |
throw a ray in the scene along the given ray
References find_inter(), and find_intersection_color().
Referenced by trace().

run ray-tracing algorithm given a 3D scene and a picture
References cpe::ray::generate_ray_from_camera(), cpe::image::get_Nx(), cpe::image::get_Ny(), cpe::image::set_pixel(), and throw_ray().

1.6.3