POV-Ray : Newsgroups : povray.advanced-users : Limited line-of-sight test? : Re: Limited line-of-sight test? Server Time
15 May 2024 16:57:49 EDT (-0400)
  Re: Limited line-of-sight test?  
From: Christian Froeschlin
Date: 9 Aug 2015 21:53:38
Message: <55c80422$1@news.povray.org>
On 31.07.2015 17:10, Cousin Ricky wrote:

> Thank you.  I was afraid to try anything involving vlength() because of
> the implicit square root calculation, but your idea turns out to be
> faster than the other ideas I tried.

Note if all you do is comparing lengths you don't need the square
root, you can compare the squared sums instead (vdot(v,v)), but of
course the extra tokens may already be more expensive.

Even more directly you can test if P1 and Hit are on the same
side of P2:

    #if (vdot(TestDirection,Pt2-Hit) >= 0)
      // Hit (Pt1->Pt2 same direction as Hit->Pt2)


Post a reply to this message

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