POV-Ray : Newsgroups : povray.newusers : Bumps, squared. : Re: Bumps, squared. Server Time
28 Jul 2024 18:24:48 EDT (-0400)
  Re: Bumps, squared.  
From: Trevor G Quayle
Date: 9 Dec 2007 20:50:01
Message: <web.475c9ab7fb428a642ae8612c0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> "Greg M. Johnson" <pte### [at] thecommononethatstartswithYcom> wrote:
> > I was trying to do some isosurface-like things with some functions.  I
> > wanted a pigment pattern which was based on the values generated by bumps
> > (or wrinkles, etc)  squared.
> >
> > I found that I could not get any syntax that would work for declaring a
> > function from a pattern and then doing arithmetic operations on it, and
> > then using THAT as a pigment pattern.
> >
> > Help is appreciated, thanks.
>
> Try using the poly_wave waveform modifier.  (I think poly_wave 2 is the one you
> want or poly_wave 0.5)
>
> -tgq

Actually, now that I thought about it, I don't think this is what you were
looking for, it affects the mapping, not the colour.  You can manipulate
pigment through colours, but keep in mind that functions don't carry vectors.
Try something like this:

#declare MyPig=pigment{bozo}  //your  priginal pigment

#declare PFunk=function{pigment{MyPig}}//declare it as a function

#declare FRd=function{PFunk(x,y,z).red  }//separate the red, green and blue
components
#declare FGn=function{PFunk(x,y,z).green}
#declare FBl=function{PFunk(x,y,z).blue }

#declare FRed=function{FRd(x,y,z)} //manipulate these functions how you want
#declare FGrn=function{FGn(x,y,z)}
#declare FBlu=function{FBl(x,y,z)}

#declare MyPig2=
pigment{average//average pigment to reassemble RGB components
  pigment_map{
      [function{FRed(x,y,z)} color_map{[0 rgb 0][1 rgb <3,0,0>]}]
      [function{FGrn(x,y,z)} color_map{[0 rgb 0][1 rgb <0,3,0>]}]
      [function{FBlu(x,y,z)} color_map{[0 rgb 0][1 rgb <0,0,3>]}]
  }
}


-tgq


Post a reply to this message

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