cpu_voxel_raycaster
cpu_voxel_raycaster copied to clipboard
could you explain the theory of fixes for rays with negative direction?
// fixes for rays with negative direction
if(ray.direction[0] < 0.0f){
ray.origin[0] = octree->size[0] - ray.origin[0];
ray.direction[0] = - ray.direction[0];
a |= 4 ; //bitwise OR (latest bits are XYZ)
}
i read the paper but i could't understand this, it says
An example where the ray direction is only negative for the X axis is now considered. In this case the ray can be reflected with respect to the middle plane of the octree to turn the negative direction component positive
it use p'x = s(q) - px
, but not p'x = center(q).x * 2 - px
. could you please tell me more detail of this equation?