POV-Ray : Newsgroups : povray.general : eval_pigment? : Re: eval_pigment? Server Time
30 Nov 2022 05:06:53 EST (-0500)
  Re: eval_pigment?  
From: Leroy
Date: 22 Nov 2022 12:45:00
Message: <web.637d08aa287863e9f64179a3f712fc00@news.povray.org>
"Leroy" <whe### [at] gmailcom> wrote:
> Related to the post above.. Why was eval_pigment dropped? Why not expand it?
> If not kept as a built in function, why not put it in one of the include files?
> Have Fun?

My Bad.. What I thought was 'eval_pigment' was drop. The real problem was
 The help file on my POV 3.7 RC7 didn't have 'eval_pigment' in the Index. I
still have 3.6 and 3.5 on my computer, they still have it. But the page they
take you to had nothing about being in 'functions.inc'. That information is
several pages away and I never did find it.
 As soon I found out that 'eval_pigment' was in 'functions.inc". I went to the
POV3.7 and found that the Help Contents lead me to 'eval_pigment' through
'functions.inc" ( the same page that's in POV3.6 & 3.5)

 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_Pig(Pig,V)
 #local V=V*<1,1,1>;
 #local Fna=function{pigment{Pig}}
#macro Eval_Cmap(Cmapp,V)
 #local V=V*<1,1,1>;
 #local Pig=pigment{gradient x color_map{Cmapp}}
 #local Fna=function{pigment{Pig}}

// Obj - object with pigment
// Pig - pigment seperate from object but translated with object
// N   - trace intersect normal to center of object
#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);
  #local R=<0,0,0>;// default color



Thanks for the help!

Have Fun!

Post a reply to this message

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