POV-Ray : Newsgroups : povray.general : pattern itterator Server Time
25 Nov 2024 10:14:32 EST (-0500)
  pattern itterator (Message 1 to 3 of 3)  
From: ricky312
Subject: pattern itterator
Date: 15 Dec 2014 14:05:00
Message: <web.548f303144192ef89fa53fe60@news.povray.org>
Hello. I thought a simple pattern iterator would be cool. Ive been trying to
make this for a while. Basically I want to copy a function many times and have
control over the omega and roughness.  I'm sure its a really simple thing but
I'm not that good at programing yet. I think I know that I should have each
octave added less ,but I can't keep it from getting too dim or bright.
this is what I have so far:


I might also try an averaged pigmentloop that might be easier.



#macro iterator(pigment_function_booleon,Function,Octaves,Omega,rough)
 (

#for(i,.1,Octaves,1)
Function(x*(i+Omega)+i,y*(i+Omega),z*(i+Omega)).grey/(i*rough)+
#end
0)/Octaves/(i*rough)
#end

#declare no_wrap=function(x) {max(min(x,1),0)}

camera{location<0,0,-5>
look_at 0}
 #declare ridge=function{pigment{bozo scale .1 triangle_wave  color_map{[0 rgb
0][1 rgb 1]}}}
 #declare ridged=function{iterator(yes,ridge,4,.5,.1) }

plane{z,0
pigment{function{no_wrap(ridged(x,y,z))}color_map{[0 rgb 0][1 rgb
1]}}finish{emission 1}}


thanks in advanced


Post a reply to this message

From: ricky312
Subject: Re: pattern itterator
Date: 15 Dec 2014 16:25:00
Message: <web.548f510786288af69fa53fe60@news.povray.org>
Here's my average iterator it seems to work okay but it has arbitrary values and
has issues.

#macro iterator(pigment_function_booleon,Function,Octaves,Omega,rough)

pigment{average pigment_map{
#for(i,.1,Octaves,1)
   #if(pigment_function_booleon)
[pow(.5(i*rough)) function{Function(x,y,z).grey}scale 1/(i*(Omega)) ]
    #else
[pow(1,(i*rough)) function{Function(x,y,z)}scale pow(i,Omega)  translate
i*Omega]
#end
#end
}}#end
#declare no_wrap=function(x) {max(min(x,1),0)}

camera{location<0,0,-5>
look_at 0}
 #declare ridge=function{pigment{bozo scale .1 triangle_wave  color_map{[0 rgb
0][1 rgb 1]}}}
 #declare ridged=function{iterator(yes,ridge,6,.6,3) }

plane{z,0
pigment{function{no_wrap(ridged(x,y,z).grey)-.1}color_map{[0 rgb 0][1 rgb
1]}}finish{emission 1}}


Post a reply to this message

From: FractRacer
Subject: Re: pattern itterator
Date: 15 Dec 2014 18:27:45
Message: <548f6e71$1@news.povray.org>

> Here's my average iterator it seems to work okay but it has arbitrary values and
> has issues.
>
> #macro iterator(pigment_function_booleon,Function,Octaves,Omega,rough)
>
> pigment{average pigment_map{
> #for(i,.1,Octaves,1)
>     #if(pigment_function_booleon)
> [pow(.5(i*rough)) function{Function(x,y,z).grey}scale 1/(i*(Omega)) ]
>      #else
> [pow(1,(i*rough)) function{Function(x,y,z)}scale pow(i,Omega)  translate
> i*Omega]
> #end
> #end
> }}#end
> #declare no_wrap=function(x) {max(min(x,1),0)}
>
> camera{location<0,0,-5>
> look_at 0}
>   #declare ridge=function{pigment{bozo scale .1 triangle_wave  color_map{[0 rgb
> 0][1 rgb 1]}}}
>   #declare ridged=function{iterator(yes,ridge,6,.6,3) }
>
> plane{z,0
> pigment{function{no_wrap(ridged(x,y,z).grey)-.1}color_map{[0 rgb 0][1 rgb
> 1]}}finish{emission 1}}
>
>
Well done, you have made a good and useful macro, I play with it and 
some others pigments.


-- 
Lionel
<b>Do not judge my words, judge my actions.</b>

---

http://www.avast.com


Post a reply to this message

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