POV-Ray : Newsgroups : povray.general : trace() function feature req : Re: trace() function feature req Server Time
13 Aug 2024 03:24:15 EDT (-0400)
  Re: trace() function feature req  
From: Dan Connelly
Date: 18 Nov 1998 19:00:16
Message: <36535F86.57DF4302@flash.net>
Ron Parker wrote:

> ...Opinions on this, especially
> from people who are using the rather bizarre current semantics,
> are welcome.


Since "=" is a float operator, and since float operations are
operated over each element of a vector (for example,
<1, 2, 3> * 4), the current implementation makes sense.

Better than the vlength solution may be the direct approach :

#macro IsZeroVector(V)
 ( (V.x=0) & (V.y=0) & (V.z=0) )
#end

#if (IsZeroVector(mynormal))
....
#end
  
> 
> >2) I'd like to have an option of specifying the length of
> >the trace vector and have trace() return 0 (no intersection) when this length
> >is exceeded.
> 
> Again, this requires an additional parameter

You asked for opinions, so....

Again, this seems an application where macros would prove
quite useful.  The burden of proof should be against modifying core
code when macros can serve similar functionality without substantial
overhead. But if the test is one which will be performed often
(and the obvious collision detection application may well provide
such a case), then perhaps the encoding is justified.

Dan

-- 
http://www.flash.net/~djconnel/


Post a reply to this message

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