|
![](/i/fill.gif) |
Wasn't it Gianluca Massaccesi who wrote:
>Hallo to everybody.
>Could anybody suggest an example to simulate a mapped trasparency plane or
>sphere, knowing the value of the trasparency at specific position?
>
>Thank you for your help.
>
If you can plot the transparency to an image, then you can use that
image_map to control a pigment_pattern
#declare transTex = texture {
pigment_pattern {image_map {jpeg "tex.jpg" interpolate 2}}
texture_map {
[0 pigment {rgbt <0,0,0,1>}]
[1 pigment {MyPigment}]
}
}
If you can express your knowledge of the transparency at a specific
position as a function then you can use that function to control a
pigment_pattern.
#declare transTex = texture {
pigment_pattern {function{abs(sin(x*4)+cos(y*8))*0.5}}
texture_map {
[0 pigment {rgbt <0,0,0,1>}]
[1 pigment {MyPigment}]
}
}
Hint: It's much easier to manage things if you ensure that your function
returns values in the range 0 to 1 (hence my use of abs() and *0.5)
rather than trying to adjust the control values of the texture_map to
work with a function that returns values outside that range.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |