spherical-volume-rendering / svr-algorithm

A spherical volume rendering algorithm that performs ray casting through a spherical voxel grid.
Other
6 stars 7 forks source link

Remove unnecessary floating point comparison in radial initialization. #196

Closed cgyurgyik closed 4 years ago

cgyurgyik commented 4 years ago

before:

  if (t_sphere_entrance < t_begin && t_sphere_exit < t_begin) {
    return {};
  }

after:

  if (t_sphere_exit < t_begin) {
    return {};
  }

It is perfectly reasonable for the ray to enter the sphere before t_begin. There is no need to check this.