POV-Ray : Newsgroups : povray.general : Looking for a formula : Re: Looking for a formula Server Time
29 Jul 2024 10:32:09 EDT (-0400)
  Re: Looking for a formula  
From: scott
Date: 18 Feb 2013 03:18:20
Message: <5121e3cc$1@news.povray.org>
> // 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.