View Full Version : stop particle rotation after collision?
liquid_tension 04-03-2006, 12:58 AM Hi, can anybody help me with an expression? I have an expression to make my particles rotate but I need them to stop rotating once they collide with a plane. so how can I do this? I dont know basically anything about mel and I have to hand in this project in which i need to create wood dust particles created by a hand saw, hope someone can help me. thanks in advance
|
|
Bonedaddy
04-03-2006, 07:54 AM
Make a custom float attr called "collisionFlag," initialize it to zero, and set it to one on its first collision event. Then, in the runtime expression, only add to the rotation if collisionFlag=0.
RaGzMaN
04-03-2006, 09:00 AM
To create an event, select the particles, then the collision object and select particle collsion events, leave the settings at default then click create event.
Now you could write an expression like the following.
if (myParticleShape.event >= 1)
{
myParticleShape.rotate = 0; //Where .rotate = your rotate value
}
else
{
myParticleShape.rotate = 180;
}
Yo bones you get anywhere with your solution with fluids?
Bonedaddy
04-03-2006, 09:29 AM
Yo bones you get anywhere with your solution with fluids?
Going to try it tomorrow (well, I guess later today) when I go into work.
liquid_tension
04-03-2006, 05:04 PM
Thanx guys, well yesterday at night I came up with the idea of creating an event so when they collide they die and create a new particle, but I came up with a new problem, first they get created but they dont keep the old rotation value they had when colliding so all the new particles are at 0 rotation, and second they start scattering through the plane they collide with like if they were sinking in mud..... do any of you know how can I fix this two problems?
RaGzMaN
04-03-2006, 06:05 PM
If your using the instancer then plug your custom rotationPP value into the rotation tab.
I would think that any solution you can come up with your going to need to use expressions and or MEL so i might brush up on those.
Back to the rotation, i thought u wanted to have the rotation set to 0 after they collide as per your initial question anyways.
With regards to the sinking, insure the particles are colliding with the surface in the dynamic relationship editor, check the tessellation factor, ensure they are being emitted above the surface not interpenetrating.
Bonedaddy
04-03-2006, 06:45 PM
The killing/emission can work, if you put your mind to it. If you're going to do it, emit it into a new particle object that isn't affected by gravity, and just have the positioning stay put. That way you don't deal with a million collisions per frame, it doesn't sink through the floor, and you're happy. Unfortunately, it won't bounce, that way.
To get the new particle to emit correctly, you'll want to run a custom MEL script on collision, that goes something like:
vector $currentRot=particleShape1.rotation;
emit -object particleShape2 -attribute myCustomRotAttr -vectorValue $currentRot.x $currentRot.y $currentRot.z;
I may have some of that mixed up, but hopefully you get the idea.
CGTalk Moderation
04-03-2006, 06:45 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.