POV-Ray : Newsgroups : povray.newusers : Wave type : Re: Wave type Server Time
18 May 2024 06:07:38 EDT (-0400)
  Re: Wave type  
From: kurtz le pirate
Date: 8 Nov 2023 10:27:30
Message: <654ba8e2$1@news.povray.org>
On 08/11/2023 12:58, Bald Eagle wrote:
> 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.
> 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
> texture.
> 
>  #declare WaveModifiedPigment =
>   texture {
>    pigment {
>           average
>           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
> 

Always there to help ;)

I've already found one method :
pigment {
	user_defined {
		function { f_sinc (x)*2 } // only red
		}
	...
	} // end of pigment

This is a partial answer to what I wanted to do, but this method can't
be combined (at least not yet) with existing patterns.

The ideal solution (for me) would be :
pigment {
	onion
	color_map { ... }
	myWaveTypeFn // for the wave
	}

myWaveTypeFn same as standard cubic_wave, poly_wave, ...


Your (and TOK) suggestion with :
pigment { average pigment_map { [ function ...
is very good and well know.
I use it to color the plane and TOK does the same.
See previous messages about domain coloring and complex numbers.

I'll keep searching ...





-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

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