POV-Ray : Newsgroups : povray.general : Looking for a formula : Re: Looking for a formula Server Time
29 Jul 2024 12:16:47 EDT (-0400)
  Re: Looking for a formula  
From: scott
Date: 15 Feb 2013 08:23:13
Message: <511e36c1$1@news.povray.org>
> I now realize what the problem is (and I should have remembered it, as it's
> fooled me in the past): Trace's 'direction' vector is solely a *direction*; it
> doesn't actually correspond to any particular point in space--like the end of
> 'line 1' in my example. It never changes. So by using this scheme and, for
> example, varying trace's 'shoot-from' point but NOT its 'direction', the
> direction it shoots in always remains 'parallel to itself', if that makes any
> sense.

Sorry it doesn't make sense to me.

If you've got line 1 defined by two end points, A and B, and line 2 
defined by two end points C and D then I would have thought the 
following would work:

Define a cylinder between points A and B with a small radius.

Use the trace command to trace from point C in direction (D-C) with the 
cylinder object. Check if there is a hit point within the length of line 
2. If no hit then trace again from point D with direction (C-D) and 
check again the hit point.


Post a reply to this message

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