Is there a way of using rsensor so that ray directions it only generates rays in the forward hemisphere?
I am using rsensor as a convenient way to generate rays that are uniformly distributed (in a statistical sense) over a hemisphere as part of a more complex process. I have a used this type of rsensor invocation (no octree given, in this example the view direction is aligned with the z axis):
$ rsensor -vth -h -vp 0 0 0 -vd 0 0 1 -vu 0 1 0 -vh 180 -vv 180 -rd 256 sensor1.dat . > rays.dat
where ‘sensor1.dat’ contains (I interpreted this as a coarse forward hemisphere definition):
degrees 0 90 180 270
0 0.0833333 0.0833333 0.0833333 0.0833333
45 0.0833333 0.0833333 0.0833333 0.0833333
90 0.0833333 0.0833333 0.0833333 0.0833333
The problem I have is that rsensor generates some rays that are in the rear hemisphere (i.e. the ray direction z component zdir < 0. in this example). In this example these can filtered out easily (using rcalc’s “cond” variable or awk) but I need to deal with the general case of an arbitrary view direction and this is quite awkward to handle at run time.