|
 |
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmail com> wrote:
> "Leroy" <whe### [at] gmail com> wrote:
>
> >...
>
> > Now that's taken care of, While I was waiting for replies, I wrote my own
> > 'Eval_pigment' & 'Eval_Cmap' &'Eval_ObjPig' macros.
>
> >...
>
> > #macro Eval_Obj_Pig(Obj,Pig,N)
> > #local Mx=max_extent(Obj);
> > #local Mn=min_extent(Obj);
> > #local Mc=(Mx+Mn)/2;
> > #local Norm = <0, 0, 0>;
> > #local Start =vlength(Mx-Mn)*N+Mc;
> > #local V = trace (Obj,Start,-N,Norm );
> > #if (Norm.x != 0 | Norm.y != 0 | Norm.z != 0)
> > #local Fna=function{pigment{Pig}}
> > #local R=Fna(V.x,V.y,V.z);
> > #else
> > #local R=<0,0,0>;// default color
> > #end
> >
> > R
> >
> > #end
>
> Hi Leroy
>
> If you want a faster macro then you'll probably find that this statement:
>
> #if (vlength(Norm) > 0)
>
> executes faster (and is easier to read) than this:
>
> #if (Norm.x != 0 | Norm.y != 0 | Norm.z != 0)
>
>
> --
> Tor Olav
> http://subcube.com
> https://github.com/t-o-k
Yes I know got lazy & use trace from
the insert that came with POV3.7 win
Post a reply to this message
|
 |