|
![](/i/fill.gif) |
I just can't memorize how to get back the colors from a pigment function let
alone transparency. I think it was possible with splines... anyway, this
should at least handle the mapping issue:
//start code
camera {
location <-25,50,-150>
look_at <0,0,-75>
angle 65
}
light_source {
<50,25,-150>
rgb <1.7,1.4,1.2>
}
#declare r=75; //minor radius
#declare R=100; //major radius
#declare f_pigm = function { pigment { image_map { png "testimage.png"
interpolate 2 }}};
//replace with your testimage
#declare f_pigm2 = function {
f_pigm((x-r)/(R-r),(y+.375*(R-r))/(.75*(R-r)),z) };
//scaled and translated function which matchs the radii of the ring
#declare f_rad = function { sqrt(x*x+y*y+z*z) } //returns the distance from
origin
disc {
0, y, R, r
pigment {
function {
f_pigm2(f_rad(x,y,z),0,0).gray
//this is where it happens, no more colors here :(
}
}
}
polygon { //displaying the test image
4,
<0,0,0>,
<0,1,0>,
<1,1,0>,
<1,0,0>
pigment {
image_map {
png "testimage.png" interpolate 2 transmit all .5
}
}
finish { ambient 1 diffuse 0 }
scale <R-r,.75*(R-r),1>
translate <r,-.375*(R-r),0>
rotate y*60
no_shadow
}
//end code
Hope this helps!
Regards Roman
Post a reply to this message
|
![](/i/fill.gif) |