POV-Ray : Newsgroups : povray.newusers : How to use self defined functions as patterns? : Re: How to use self defined functions as patterns? Server Time
29 Feb 2024 10:28:02 EST (-0500)
  Re: How to use self defined functions as patterns?  
From: Thorsten Froehlich
Date: 4 Apr 2018 08:05:01
Message: <web.5ac4bed81863261df773ca290@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> "rastertastic" <nomail@nomail> wrote:
>
> >
> > So basically I'm asking clarification on how to use such self-defined functions
> > like  x + y + z  as patterns with, say, color maps.
>
> Here's a simple example...
>
> #declare Foo = function(x,y){2*x + 2*y}
>
> box{<0,0,0>, <1,1,.01>
> pigment {
>   function {Foo(x,y)}
>        sine_wave // otherwise, a default 'ramp' wave is used
>        color_map{
>               [0 rgb 0]
>               [1 rgb 1]
>               }
>        }
>        }

This just discards the z position of the function.

> BTW, somewhere in the POV-Ray documentation, it states that when using a
> function as a pigment or pigment pattern, the 'image' of the function is
> actually just an infinitely thin slice, taken in the x/y plane (x from 0.0 to
> 1.0, y from 0.0 to 1.0). You can change the location of that slice, though:
>                  #declare Foo = function(x,y){2*(x + 1.7) + 2*y}

It does not say that, the pattern function is three dimensional, not two
dimensional. You are free to not use all three dimensions though.


Post a reply to this message

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