POV-Ray : Newsgroups : povray.newusers : Wave type : Re: Wave type Server Time
28 Nov 2023 05:11:23 EST (-0500)
  Re: Wave type  
From: Bald Eagle
Date: 8 Nov 2023 16:45:00
Message: <web.654c014be2639fbb1f9dae3025979125@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:

> The ideal solution (for me) would be :
> pigment {
>  onion
>  color_map { ... }
>  myWaveTypeFn // for the wave
>  }
> myWaveTypeFn same as standard cubic_wave, poly_wave, ...

I think this might work:

Take onion, and make it

#declare Onion = function {pigment {onion}}

Now define a user-defined wave function to apply to the domain of the original
pigment function

#declare Wave = function {sin (Onion (x, y, z)*tau)}

 pigment {
  color_map { ... }
  // and now the wave function is already built into the pigment pattern

You just need to use the 0-1 values returned by your pigment pattern as the
input for your wave function.

If you're going to be using a pigment pattern that POV-Ray assigns an in-built
color_map to, then you need to override that in your original pigment function
with a user-defined color map going from black (1) to white (1).

#declare Onion = function {pigment {onion} color_map {[0 rgb 0] [1 rgb 1]}}

- BW

Post a reply to this message

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