POV-Ray : Newsgroups : povray.beta-test : HF* macros issues : Re: HF* macros issues Server Time
29 Jul 2024 16:33:17 EDT (-0400)
  Re: HF* macros issues  
From:
Date: 22 Apr 2002 08:35:51
Message: <md08cuout2dehhtgv6rk7ch67a7rk5h9pn@4ax.com>
On Tue, 16 Apr 2002 21:27:42 +0200, "Rune" <run### [at] mobilixnetdk>
wrote:
> > 3. First loop use two locals but can be realised with only one.
> >    Here is my version of first loop with speed optimization
> >    but without annoying #debug
>
> Whoops, the debug is a leftover from my tests. Don't know how it got
> there...
>
> Actually, the test to see if the vector has zero length is also a leftover
> from the debugging. Currently the macro should never reach that part anyway,
> so it can be removed completely. I will do so.

Your changes seems better now except AFAIK you not necessary normalize vector
before calculating cross product (you only inrease floating point error at
this moment) in HFCreate_() macro. Consider below example:

#include "strings"
#local A=<126,45,33>;
#local B=<63,12,7>/1000;
#declare C=vnormalize(vcross(vnormalize(A),vnormalize(B)));
#declare D=vnormalize(vcross(A,B));
#warning VStr(C)
#warning VStr(D)

ABX


Post a reply to this message

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