POV-Ray : Newsgroups : povray.newusers : Wave type : Re: Wave type Server Time
28 Nov 2023 03:53:17 EST (-0500)
  Re: Wave type  
From: Bald Eagle
Date: 8 Nov 2023 07:00:00
Message: <web.654b77ffe2639fbb1f9dae3025979125@news.povray.org>
kurtz le pirate <kur### [at] gmailcom> wrote:
> Hello
> Is it possible to customize "wave_form" in color patterns ?
> Thanks

Well, ... yes, but as far as I know, you can only do it in the TOK / Bald Eagle
over-complicated "write the whole thing yourself from scratch" method.

You know that you can use a function to define a pigment pattern,
pigment {function {}}
and that you can have POV-Ray convert any inbuilt pigment pattern into a
function {pigment {}}

So what you do, is you take your pattern, convert it into a function, and then
use a user-defined function to modulate that 0-1 range according to the
wave_type that you implement in your function.

#declare f_Pattern = function {pigment {}}
#declare f_Wave = function {my_wave_type}
#declare WavePattern = function {f_Pattern * f_Wave}

Then you make a texture using the "average" pattern, and use the product of your
pattern function and wave function to control the rgbft values in the average

 #declare WaveModifiedPigment =
  texture {
   pigment {
          pigment_map {
                  function { WavePattern (x, y, z).red }
                  color_map {
                      [ 0 red 0 ]
                      [ 1 red 5 ]
          ... etc

Depending upon your exact needs, you _might_ need to create a special cumulative
distribution function (cdf) using a spline, and then employ importance sampling
by writing a probability density function (pdf) to return your color_map value
from the cdf for any given pattern value.  And THAt will be your actual f_Wave
function that you use in the average texture.

Hope that "helps".

- Bill

Post a reply to this message

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