|
|
Hi,
a newbie question:
I want to create objects, where I want to calculate the r,g,b and
transparency values of the pigment rgb color with self written functions.
Unfortunately, I could not find a way to declare this. Whatever I try,
povray does not accept it as correct. It looks as if the povray language
is not really orthogonal.
How would I achieve to have texture where all four channels (rgbt) are
calculated with function?
Is this restricted to 1-dimensional calculations and mapping with a
color map?
regards
Hadmut
Post a reply to this message
|
|
|
|
Hadmut Danisch schrieb:
>
> How would I achieve to have texture where all four channels (rgbt) are
> calculated with function?
At present, the virtual machine used to implement functions in POV-Ray
does not support vectors. However, you can achieve the desired effect
with average pigments as follows:
- Declare four functions, one for each of R, G and B and T.
- Mix and color the RGB components using the 'average' pattern (note
that each component is "colorized" with a factor of 3):
#declare MyPigmentRGB = pigment {
average
pigment_map {
[1 function { MyFnR(x,y,z) } color_map [0 rgb 0][1 red 3]]
[1 function { MyFnG(x,y,z) } color_map [0 rgb 0][1 green 3]]
[1 function { MyFnB(x,y,z) } color_map [0 rgb 0][1 blue 3]]
}
}
- To mix in the transparency, use another pigment map to fade between
the RGB pigment as above, and a purely transparent pigment:
#declare MyPigmentRGBT = pigment {
function { MyFnT(x,y,z) }
pigment_map {
[0 MyPigmentRGB]
[1 color rgbt 1]
}
}
(Didn't test either of these; I may have introduced one or two syntax
errors.)
Post a reply to this message
|
|