|
|
Wasn't it Brent G who wrote:
>Here's my code:
>difference {
> box {
> <-2, -1, 0.1>, <2, 1, 1>
> texture { T_Stone10
> color filter clock }
> }
> text {
> ttf "timrom.ttf" "Text" 0.15, 0
> pigment { BrightGold
> color filter clock }
> finish { reflection .25 specular 1 }
> translate -1.05*x
> }
>}
>
>Which is What I want to do, but isnt' valid. What I'm trying to do is
>change the transparency of the objects for an animation so they fade in
>over the course of the animation. clock goes from 0 to 1.
1. For a plain colour like BrightGold, a valid syntax is like this:
text {
ttf "timrom.ttf" "Text" 0.15, 0
#declare CFC = color filter clock;
pigment { BrightGold + CFC }
finish { reflection .25 specular 1 }
translate -1.05*x
}
2. For a complicated texture like T_Stone10 you can't apply filter to
the whole thing. What you'd have to do is take a copy of the
T_Grnt3a, T_Grnt17a and T_Stone10 declarations from stones1.inc and
change all the rgbt colours into rgbft, inserting "clock," as the
fourth component, like this:
#declare T_Grnt3a =
texture {
pigment
{granite
turbulence 0.6
color_map
{[0.000, 0.153 color rgbft <0.831, 0.631, 0.569, clock, 0.447>
color rgbft <0.925, 0.831, 0.714, clock, 0.678>]
[0.153, 0.297 color rgbft <0.925, 0.831, 0.714, clock, 0.678>
color rgbft <0.871, 0.702, 0.659, clock, 0.475>]
[0.297, 0.441 color rgbft <0.871, 0.702, 0.659, clock, 0.475>
color rgbft <0.831, 0.631, 0.569, clock, 0.918>]
[0.441, 0.763 color rgbft <0.831, 0.631, 0.569, clock, 0.918>
color rgbft <0.937, 0.882, 0.820, clock, 0.655>]
[0.763, 1.001 color rgbft <0.937, 0.882, 0.820, clock, 0.655>
color rgbft <0.831, 0.631, 0.569, clock, 0.447>]
}
}
}
3. However, this doesn't cause the object to fade in during the course
of the animation. That's not what "filter" does, you are probably
thinking of "transmit". This is particularly noticeable in the case
of the Black layer of T_Stone10. When the layer is "Black + filter 0"
it is opaque and black. When the layer is "Black + filter 1" then
light is considered to pass through the object, but on the way
through the colour of the light is changed to being completely black.
You can easily do the plain colour with transmit, but the layers of that
stone texture already contain some transmit. So you'd have to modify
them so that the transmit varies from the initial value when clock=0 to
1 when clock=1, something like this:
#declare T_Grnt3a =
texture {
pigment
{granite
turbulence 0.6
color_map
{[0.000, 0.153 color rgbt <0.831, 0.631, 0.569, 0.447+0.553*clock>
color rgbt <0.925, 0.831, 0.714, 0.678+0.322*clock>]
[0.153, 0.297 color rgbt <0.925, 0.831, 0.714, 0.678+0.322*clock>
color rgbt <0.871, 0.702, 0.659, 0.475+0.535*clock>]
[0.297, 0.441 color rgbt <0.871, 0.702, 0.659, 0.475+0.535*clock>
color rgbt <0.831, 0.631, 0.569, 0.918+0.082*clock>]
[0.441, 0.763 color rgbt <0.831, 0.631, 0.569, 0.918+0.082*clock>
color rgbt <0.937, 0.882, 0.820, 0.655+0.545*clock>]
[0.763, 1.001 color rgbt <0.937, 0.882, 0.820, 0.655+0.545*clock>
color rgbt <0.831, 0.631, 0.569, 0.447+0.553*clock>]
}
}
}
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|