|
|
Warp <war### [at] tagpovrayorg> wrote:
> SharkD <nomail@nomail> wrote:
> > Could you please post an example?
>
> #default { finish { ambient 1 } }
> background { rgb z*.5 }
> camera { location <0, 0, -10> look_at 0 angle 35 }
>
> #declare ThePattern = function { pattern { gradient y } };
> #declare SteppedPattern = function { int(10*ThePattern(x, y, z))/10 };
>
> // Original pattern:
> box
> { <-1, -2, 0>, <1, 2, .1>
> pigment
> { function { ThePattern(x, y, z) }
> color_map { [0 rgb 0][1 rgb 1] }
> }
> translate -x*1.1
> }
>
> // Stepped pattern:
> box
> { <-1, -2, 0>, <1, 2, .1>
> pigment
> { function { SteppedPattern(x, y, z) }
> color_map { [0 rgb 0][1 rgb 1] }
> }
> translate x*1.1
> }
>
>
> --
> - Warp
Thanks for the response! I turned your suggestion into a wiki article so that
others may benefit from it.
http://wiki.povray.org/content/HowTo:Turn_a_function_into_a_stepped_function
-Mike
Post a reply to this message
|
|