Connect Translate to Particle RGb

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 08 August 2003   #1
Connect Translate to Particle RGb

Is it possible to connect the translate of an emitter or even the particle point or multi points to their RGB

I know it is possible to connect a surface point in space to its RGB so it changes color as it moves around so I thought this might be handy for particles
 
Old 08 August 2003   #2
Yes you can.

For the emitter you could have it translation (x,y,z) translation pass to the particle runtime expression using xform and you could use use position (which is per particle) for each particle.

You can do it per object or per particle basis.

The only thing you have to do is normalizing it to certain range.

Best regards,
 
Old 08 August 2003   #3
I am not to familiar with xform, can you post a screenshot of hypershade and the needed expression or write out the steps



Thanks
 
Old 09 September 2003   #4
This is a small expression that work per object basis:

Particle shape I'm using is point, and I add color per object attribute to it.
Color will be derived from positionY of emitter, 0 will give black, 10 will give red. And I do a linstep between these 2 values. Since linstep will clamp the output to 1 above max value, I didn't need to do any checking on it.

Quote: float $emitterPos[3] = `xform -q -ws -t emitter1`;
float $red = linstep (0, 10, $emitterPos[1]);
particleShape1.colorRed = $red;


first line is checking the position of emitter1, second line will interpolate it if the value is between 0 to 10 or set to 0 if it is less than 0, and set it to 1 if it is more than 10.
third line will pass result value back to colorRed.

If you need to do on per particle base, then you need to check each particle position and get the value, and sent it back to particle shape using `particle` command.

BTW: I didn't use any of hypershade related node in this case, just an expression.

Best regards,
 
Old 09 September 2003   #5
It is possible to connect translateX of emitter to rgbPP with expressions :


float $redpp = linstep (0, 20, emitter2.translateX );
particleShape2.rgbPP = << $redpp,0,0>>

when the emitter move, particles change color, black to red

if you want,

file maya
 
Old 01 January 2006   #6
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:51 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.