|
|
Mike Williams <nos### [at] econymdemoncouk> wrote:
#declare bender = .2*sin(1*pi*y + 5);
>
> One of the things that's going on is that "y" has two different meanings
> in POV. When you're using it in a parse-time variable, like that, it's
> interpreted as the vector <0,1,0>.
A new discovery for me. Thanks.
>
> Another thing that's going on is that you don't want "bender" to be
> evaluated at parse time. That would effectively make it behave like a
> constant during the render.
Yes, I did have a vague notion that this might be happening... but was
hoping not! ;-)
> You want it to be a function that varies
> with y during the render, so that different parts of the object are bent
> by different amounts.
I understand completely. (Though I have to admit, I'm still a bit fuzzy on
which things happen during parsing and which during rendering. But your
explanation has helped close that gap.)
>
> #declare bender = function(y){ .2*sin(1*pi*y + 5)}
Excellent! Thanks so much. I wouldn't have thought of that. I also see that
I need to use brackets (around the expression) rather than parentheses.
Because it's a function. Ohhhh....
>
> Then you can write things like
>
> isosurface{
> function {
> sqrt( pow(x+bender(y),2) + pow(z,2)) -0.05
> }
Just what I was looking for. Thanks for "opening my eyes." This technique
will be VERY useful.
Ken
Post a reply to this message
|
|