|
![](/i/fill.gif) |
> // ORANGE--the other line. These are the start and end points, which
> // are also used in trace().
> #declare trace_shoot_from = <-2,9,0>;
> #declare trace_direction = <18,-8,0>; // i.e., the line end point
?? The above line really confused me, the trace direction is not the
line end point. The trace direction is the difference between the start
and end point (and possibly normalized too to make it clear it's a
direction).
> // ORANGE--The other line--which might be imagined to be the trace
> // ray direction, but is not.
> cylinder{trace_shoot_from,trace_direction, .1
> no_shadow
> pigment{rgb 1*<1,.7,0>}
> }
You shouldn't be using a direction vector as a parameter for the
cylinder primitive...
Much clearer to write it like this:
#declare trace_shoot_from = <-2,9,0>; // line start point
#declare trace_shoot_to = <18,-8,0>; // i.e., the line end point
#declare trace_shoot_direction = vnormalize(trace_shoot_to -
trace_shoot_from);
...
trace(target_object,trace_shoot_from,trace_direction,norm);
...
cylinder{trace_shoot_from,trace_shoot_to, .1}
Post a reply to this message
|
![](/i/fill.gif) |