|
|
news:4019c041@news.povray.org...
> If I have declared an object earlier in a file, how can I change the
> object's transparency when I'm using it in a pov scene? For example:
> #include "colors.inc"
> global_settings{assumed_gamma 1.0}
> camera{location <2,3,-7> look_at 0}
> light_source{<10,20,-10> rgb 1 parallel point_at 0}
> plane{y,-2 pigment{color Green}}
> #declare SillyObject=union {
> box{<-2,-2,-.5>,<2,2,.5> pigment{color Blue}}
> box{<-.5,-2,-2>,<.5,2,2> pigment{color Blue}}
> cylinder{y*2,y*2.5,.25 pigment{color Red}}
> }
> object{SillyObject //transmit .5 <==this is what I've been trying to use
> }
>
> I would define a variable for SillyObject's pigment, except in real life
> SillyObject is defined in an include file, and also its components are
> different colors, so it isn't convenient to make its transparency
dependent
> on a variable. Can I change aspects of its color in the scene without
> having a variable to refer to the color?
> Thanks,
> Kneb
-- in the include file :
#if undefined(SillyObjectTransmitValue)
#declare SillyObjectTransmitValue = 0.0;
#end
#declare SillyObject=union {
box{<-2,-2,-.5>,<2,2,.5> pigment { color Blue transmit
SillyObjectTransmitValue }}
box{<-.5,-2,-2>,<.5,2,2> pigment { color Blue transmit
SillyObjectTransmitValue }}
cylinder{y*2,y*2.5,.25 pigment { color Red transmit
SillyObjectTransmitValue }}
}
-- in the main pov scene :
#declare SillyObjectTransmitValue = 0.6;
#include "theSillyObjectIncludeFile.inc"
hope that help !
Post a reply to this message
|
|