Detail of project Visionaray

This page details the project Visionaray

1. Presentation

The project Visionaray is developed by SEARIS. It is a cross platform ray tracing library. The codes are based on language C++.

The interesting part for us is : visionaray/include/visionaray/math/ (github.com/szellmann/visionaray/tree/master/include/visionaray/math). It detail the mathematical tools.

2. General Structure

The repository consist of the following folders :

  • include/visionaray : regroups the heart of code (tools for traiting surfaces, create ray …​ )

  • include/visionaray/math : regroups the mathematical tools (Most important part for the internship)

  • src/ :

3. Interseption of ray

The relevant part for this work is the script intercept.h (in include/visionaray/math/), wich details when a ray (represented by an origin \(O\) point and directional vector \(\mathbf{v}\)) is intercepted by a geometrical object in 3D space.

See Visionaray Method for more details on the theoretical geometry. In this section some algebraic conditions should be met in order to verify whether there interception or not.

Cases of interception :

The code of visionarray doesn’t take into account ray direction. The intersection is not with semi-right but with right. In geometrical tools, we take into account the sens of ray.

It introduce the class hit_record<basic_ray<T>, …​.> that represent the intersection or not of a ray and geometrical object, it is composed by :

  • mask_type hit : 1 if it intersects, 0 if not

  • prim_id : represents the type of primitive of geometrical object

  • geom_id : represents the type of geometrical object

  • some arguments usefull to calculate the intersection or not

The function hit_record<basic_ray<T>, basic_aabb<U>> intersect calculates the conditon of intersection and returns a corresponding hit_record.

References