Rune wrote:
>
> I see many people use
>
> #if ( Vector.x=0 & Vector.y=0 & Vector.z=0 )
> and
> #if ( Vector.x!=0 & Vector.y!=0 & Vector.z!=0 )
>
> I personally find it much simpler to use
>
> #if (vlength(Vector)=0)
> and
> #if (vlength(Vector)!=0)
>
> I just thought I'd share it with you.
>
> Rune
If you consider speed optimization, how about:
#if ( abs(Vector.x)+abs(Vector.y)+abs(Vector.z)=0 )
I don't know how fast povray calculates vlength(), but in regular programming
this would probably be faster, because vlength() would have to use
multiplication and sqrt().
Christoph
--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/
Post a reply to this message
|