POV-Ray : Newsgroups : povray.advanced-users : Evaluating pattern Server Time
30 Jul 2024 04:24:22 EDT (-0400)
  Evaluating pattern (Message 1 to 5 of 5)  
From: Gail Shaw
Subject: Evaluating pattern
Date: 26 Jan 2000 10:21:24
Message: <388f10f4@news.povray.org>
I recall that someone (Chris Huff? ) wrote a patch so that the value of a
pattern could
be evaluated at a point. Is this available in megapov, if not is there any
way I could find out the value of a pigment at a certain point in a pattern?

I have a bozo pattern (pigment) and I want to be able to get 15 random
pigments that
the pattern would have produced.

did that make any sense?

Gail
*******************************************************************
* gsh### [at] monotixcoza              * ERROR: COFFEE.COM not found  *
* http://www.rucus.ru.ac.za/~gail/ * Insert cup and press any key *
*******************************************************************
* Definition of an upgrade: Take the old bugs out, put new ones in*
*******************************************************************


Post a reply to this message

From: Chris Huff
Subject: Re: Evaluating pattern
Date: 26 Jan 2000 17:29:01
Message: <chrishuff_99-799DDB.17294026012000@news.povray.org>
In article <388f10f4@news.povray.org>, "Gail Shaw" 
<gsh### [at] monotixcoza> wrote:

> I recall that someone (Chris Huff? ) wrote a patch so that the value of a
> pattern could
> be evaluated at a point. Is this available in megapov,

Yes, I am the one who wrote the eval_pattern patch. No, it isn't in 
MegaPOV, but it should be included in a future version.


> if not is there  any
> way I could find out the value of a pigment at a certain point in a 
> pattern?

Probably the only way would be to translate the code from the POV source 
into the POV-Ray scene description language, and make a macro for the 
patterns. This would only be easy for simple things like gradient, 
spherical, etc. Bozo or anything else using a noise function would 
probably be quite difficult.


> I have a bozo pattern (pigment) and I want to be able to get 15 random
> pigments that the pattern would have produced.

I am not quite sure what you mean, do you want 15 different colors? Or 
15 different values? eval_pattern() returns the float value of a pattern 
at a specific point, eval_pigment() returns the color of a pigment.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Colefax
Subject: Re: Evaluating pattern
Date: 26 Jan 2000 17:50:33
Message: <388f7a39@news.povray.org>
Gail Shaw <gsh### [at] monotixcoza> wrote:
> I recall that someone (Chris Huff? ) wrote a patch so that the value of a
> pattern could
> be evaluated at a point. Is this available in megapov, if not is there any
> way I could find out the value of a pigment at a certain point in a
pattern?
>
> I have a bozo pattern (pigment) and I want to be able to get 15 random
> pigments that
> the pattern would have produced.

Would translating the pigment by random amounts be enough?  I use this
method in the Galaxy include file to produce differently shaped nebulae,
based on POV-Ray's various noise patterns, eg:

   #declare R1 = seed(0);
   #declare Patterns = array[15]

   #declare C = 0; #while (C < 15)
      #declare Patterns[C] = pigment {bozo
         translate (<rand(R1), rand(R1), rand(R1)>-.5)*1000}
   #declare C = C + 1; #end

Depending on how random you want the patterns you could add random scalings
and rotations as well.


Post a reply to this message

From: Gail Shaw
Subject: Re: Evaluating pattern
Date: 27 Jan 2000 01:25:35
Message: <388fe4df@news.povray.org>
>> I have a bozo pattern (pigment) and I want to be able to get 15 random
>> pigments that the pattern would have produced.
>
>I am not quite sure what you mean, do you want 15 different colors? Or
>15 different values? eval_pattern() returns the float value of a pattern
>at a specific point, eval_pigment() returns the color of a pigment.
>


I want the pigment value at 15 different points in space. eg
pigment {
 bozo
 color_map {
  [0.0 White]
  [1.0 Blue]
 }
}

I want to know what colour the point at <5,2,-9> will be if this pattern is
applied.

Gail
*******************************************************************
* gsh### [at] monotixcoza              * ERROR: COFFEE.COM not found  *
* http://www.rucus.ru.ac.za/~gail/ * Insert cup and press any key *
*******************************************************************
* Definition of an upgrade: Take the old bugs out, put new ones in*
*******************************************************************


Post a reply to this message

From: Gail Shaw
Subject: Re: Evaluating pattern
Date: 27 Jan 2000 01:32:18
Message: <388fe672@news.povray.org>
Chris Colefax wrote in message <388f7a39@news.povray.org>...
>Would translating the pigment by random amounts be enough?  I use this
>method in the Galaxy include file to produce differently shaped nebulae,
>based on POV-Ray's various noise patterns, eg:
>
>   #declare R1 = seed(0);
>   #declare Patterns = array[15]
>
>   #declare C = 0; #while (C < 15)
>      #declare Patterns[C] = pigment {bozo
>         translate (<rand(R1), rand(R1), rand(R1)>-.5)*1000}
>   #declare C = C + 1; #end
>
>Depending on how random you want the patterns you could add random scalings
>and rotations as well.


thanks, that's just perfect.

Gail
*******************************************************************
* gsh### [at] monotixcoza              * ERROR: COFFEE.COM not found  *
* http://www.rucus.ru.ac.za/~gail/ * Insert cup and press any key *
*******************************************************************
* Definition of an upgrade: Take the old bugs out, put new ones in*
*******************************************************************


Post a reply to this message

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