|
|
Chambers <ben### [at] pacificwebguycom> wrote:
> #declare my_obj = object { ... }
> #declare v_orig = <...>;
> #declare v_dir = <...>;
> #declare intersection = <0,0,0>;
> #declare norm = <0,0,0>;
> #declare intersection = trace(my_obj, v_orig, v_dir, norm)
>
> #declare hit = false;
> #if (intersection.x != 0) #declare hit = true; #end
> #if (intersection.y != 0) #declare hit = true; #end
> #if (intersection.z != 0) #declare hit = true; #end
Why not instead use
#declare hit = (vlength(intersection) > 0);
Or, as we're being on it, do the proper thing and test for the normal instead of
the intersection point (which *could* happen to be <0,0,0> after all):
#declare hit = (vlength(norm) > 0);
Post a reply to this message
|
|