POV-Ray : Newsgroups : povray.advanced-users : operator (or variable?) substitution in a function? : operator (or variable?) substitution in a function? Server Time
6 Oct 2024 13:52:04 EDT (-0400)
  operator (or variable?) substitution in a function?  
From: Kenneth
Date: 25 Oct 2006 23:40:01
Message: <web.45402cb96b2c582d870dc4da0@news.povray.org>
I'm using a function in an isosurface to create a "bent" vertical
cylinder...

isosurface{
function{
sqrt(pow(x + .2*sin(1*pi*y + 5),2) + pow(z,2)) - .05
}
}

..... with the expression  +.2*sin(1*pi*y + 5)  being the "bender" (with a
vertical displacement for the sine wave.)

I'm using this same bending expression in other parts of the isosurface (in
other equations) as well as in other isosurfaces. Currently, I just plug in
the expression wherever I need it...which is tedious.

In hopes of creating a single variable(?) that I could plug in instead, I
tried...

#declare bender = .2*sin(1*pi*y + 5);

but I get the error message at that line, "Float expected but vector or
color expression found."

I have a vague idea why this isn't working (having to do with y being a kind
of undefined generic operator, but which POV-Ray is seeing as a color
operator--I think). But is there a workaround to what I'm trying to do? Or
is operator substitution like this not possible? (I don't know where to
look in the POV docs to find the answer.)

Ken W.


Post a reply to this message

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