Helper class for running ray-tracing algorithm. More...
Static Public Member Functions | |
static void | trace (const scene3d &scene, const render_parameters &render_param, image *pic) |
run ray-tracing algorithm given a 3D scene and a picture | |
static color | throw_ray (const scene3d &scene, const ray &ray_current, const render_parameters &render_param) |
throw a ray in the scene along the given ray | |
static intersection_object | 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 std::vector< double > | ray_to_light (const v3 ¤t_position, const scene3d &scene) |
throw ray to the direction of every lights | |
static color | compute_color (const std::vector< double > &t_light, const intersection_object &inter, const scene3d &scene, const render_parameters &render_param) |
compute the color associated to the vector of distance from every light sources | |
static color | find_intersection_color (const intersection_object &inter, const scene3d &scene, const render_parameters &render_param) |
compute the color associated to a intersection |
Helper class for running ray-tracing algorithm.
color cpe::ray_tracer::compute_color | ( | const std::vector< double > & | t_light, |
const intersection_object & | inter, | ||
const scene3d & | scene, | ||
const render_parameters & | render_param | ||
) | [static] |
compute the color associated to the vector of distance from every light sources
References cpe::material::c, cpe::scene3d::get_material(), and cpe::intersection_object::id_object.
Referenced by find_intersection_color().
intersection_object cpe::ray_tracer::find_inter | ( | const ray & | ray_current, |
const scene3d & | scene | ||
) | [static] |
find the intersection between a given ray and the first object in the 3D scene
References cpe::scene3d::get_object(), cpe::object3d::intersect(), and cpe::scene3d::N_object().
Referenced by throw_ray().
color cpe::ray_tracer::find_intersection_color | ( | const intersection_object & | inter, |
const scene3d & | scene, | ||
const render_parameters & | render_param | ||
) | [static] |
compute the color associated to a intersection
References compute_color(), cpe::intersection_object::inter_data, ray_to_light(), and cpe::intersection_data::x.
Referenced by throw_ray().
std::vector< double > cpe::ray_tracer::ray_to_light | ( | const v3 & | current_position, |
const scene3d & | scene | ||
) | [static] |
throw ray to the direction of every lights
References cpe::scene3d::N_light().
Referenced by find_intersection_color().
color cpe::ray_tracer::throw_ray | ( | const scene3d & | scene, |
const ray & | ray_current, | ||
const render_parameters & | render_param | ||
) | [static] |
throw a ray in the scene along the given ray
References find_inter(), find_intersection_color(), cpe::scene3d::get_background_color(), and cpe::intersection_object::id_object.
Referenced by trace().
void cpe::ray_tracer::trace | ( | const scene3d & | scene, |
const render_parameters & | render_param, | ||
image * | pic | ||
) | [static] |
run ray-tracing algorithm given a 3D scene and a picture
References cpe::ray::generate_ray_from_camera(), cpe::scene3d::get_camera(), cpe::image::get_Nx(), cpe::image::get_Ny(), cpe::image::set(), and throw_ray().
Referenced by main().