How can a particle Collision event trigger an animated change in texture?

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  04 April 2011
How can a particle Collision event trigger an animated change in texture?

Hey guys,

I'm busy with a scene where there are bouncey balls (nparticles) colliding with mutliple cubes in the scene. The effect I'm going for is whenever a particle collides with a cube I want that cube to light up and then fade to its original colour again. So the bouncing particles make the cubes light up whenever they collide.

All I need to achieve this is a collision event to drive a value between 0 and 1 which will be used as a fade between 2 textures. When the value is 0 it displays texture A, when the value is 1 it displays texture B.

So far I have a MEL command running on a collision event with one surface. I'm getting the first collision to adjust the value of a multiplyDivide node from 0 to 1, but it just stays at that value after the first collision. I don't know how to make the mel script fade the value back to 0 after a given number of frames. and then push the value back to 1 on the next collision.

The MEL script for my event so far looks like this..
global proc shader_Switch (string $nParticle1, int $particleId, string $pPlane1)
   {setAttr "multiplyDivide1.input1X" 1;}

shader_Switch is my collision event, nParticle1 is my particle object, pPlane 1 is the object the particle shape is colliding with.

So what I have at the moment is the first collision between particle and surface adjusting a value from 0 to 1, and then nothing further happens.
But what I need is that value to change from 0 to 1 and then fade back to 0 on each particle/surface collision.

Would love to know how to do this, the concept seems quite simple and I'm sure it's possible. Any help would be greatly appreciated.


Last edited by LinchpinZA : 04 April 2011 at 02:45 PM.
  04 April 2011
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
Society of Digital Artists

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

All times are GMT. The time now is 07:05 AM.

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