cpe::ray_tracer Class Reference

Helper class for running ray-tracing algorithm. More...

List of all members.

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 &current_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

Detailed Description

Helper class for running ray-tracing algorithm.


Member Function Documentation

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().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

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

Returns:
the vector containing the distances from current_position to the lights (distance=-1 if we are in the shadow of an other object)

References cpe::scene3d::N_light().

Referenced by find_intersection_color().

+ Here is the call graph for this function:

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

Returns:
the color associated to this ray

References find_inter(), find_intersection_color(), cpe::scene3d::get_background_color(), and cpe::intersection_object::id_object.

Referenced by trace().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:


The documentation for this class was generated from the following files: