|
![](/i/fill.gif) |
"slehar" <sle### [at] gmail com> wrote:
> That works OK, and makes a pattern like a 4th harmonic standing wave in a
> flute. But can you modify that pattern with mathematical manipulations, for
> example to subtract 0.5 from each point in the density function, then
> multiply by two, so as to shift it from the range 0 to 1 into the range -1
> to +1?
>
> Or can you take each point in the density map, and raise its value to some
> exponential i.e. p[x,y,z] = exp(p[x,y,z], expVal)?
>
> Or take the square root of each value i.e. p[x,y,z] = sqrt(p[x,y,z])?
You can do this directly without all that tedious mucking about with
waveform tricks and gradients. Scalar functions can be used directly as
patterns (in POV v3.6.1's manual, this is section 3.5.11.15: "Function as
pattern").
For your sine example I'm guessing the density would look like this:
density {
function { 0.5 *(1 + sin(y*4*(2*pi))) }
color_map {
[0 color red 1]
[1 color green 1]
}
}
(Your other examples similarly). The manual states that color_map entries
are clipped to the [0..1] range in section 3.5.1.3 "Color Maps", so the
density is too, although I guess that only matters if you don't use
function {} for the density.
Tom
Post a reply to this message
|
![](/i/fill.gif) |