mahigitam
05-26-2009, 12:41 PM
hi frens.this is my first post in cg society.
i used a volume emitter,of size 10 units and a volume field of d same size with field direction inwards.now the particels will be ttravelling from edge to edge..now i want to edit the color of the particles based on the distance.i used a expression which i cudnt succeed..cud u guys plz help me wer i went wrong...
those particles within a range of (0-3units) shud have red color,(3-6units) green color and (6-10units) blue color...actually this problem was in the maya help file(which was done using ramps)...below is my expression list
float $pos=mag(particleShape1.position);
particleShape1.posi=$pos;
if(0<particleShape1.posi<3)
particleShape1.rgbPP=<<1,0,0>>;
else
{
if(3<particleShape1.posi<6)
particleShape1.rgbPP=<<0,1,0>>;
else
particleShape1.rgbPP=<<0,0,1>>;
}
i introduced a new attribute called "posi"which is a data type of "float" and pp(Array) attribute
i used a volume emitter,of size 10 units and a volume field of d same size with field direction inwards.now the particels will be ttravelling from edge to edge..now i want to edit the color of the particles based on the distance.i used a expression which i cudnt succeed..cud u guys plz help me wer i went wrong...
those particles within a range of (0-3units) shud have red color,(3-6units) green color and (6-10units) blue color...actually this problem was in the maya help file(which was done using ramps)...below is my expression list
float $pos=mag(particleShape1.position);
particleShape1.posi=$pos;
if(0<particleShape1.posi<3)
particleShape1.rgbPP=<<1,0,0>>;
else
{
if(3<particleShape1.posi<6)
particleShape1.rgbPP=<<0,1,0>>;
else
particleShape1.rgbPP=<<0,0,1>>;
}
i introduced a new attribute called "posi"which is a data type of "float" and pp(Array) attribute
