PDA

View Full Version : instancer flicker


johnnymr75
05-18-2010, 06:42 PM
Hi all,

I"m working with an instanced rock on a particle sim, my problem is that I have a collision object for the particles to collide with and the instanced rocks seem to flicker or more like a jitter motion, my geo connector settings are resilience 0.2, friction 0.5. any suggestions on how to keep the behavior of the rocks natural and not jitter?? also the particle sim is cached...am I missing something???
Thanx

mandark1011
05-18-2010, 07:53 PM
im assuming you mean when your rocks come to a stop? If so you need to kill velocity on your particles once a "rest" state has been met.
//runtime
if (velocity <=.01)
velocity = 0;

Wick3dParticle
05-18-2010, 08:06 PM
There are a few ways to solve this:

Technically you want to create an event or detect when velocity is very low, and use that to drive the particles to complete stop.


A very simple example would look like this:

//create an empty collision event
//this is a runtime expression

vector $pos = particleShape1.worldPosition;
if (particleShape1.event > 5){

particleShape1.position = <<$pos.x, 0, $pos.z>>;
particleShape1.velocity = 0;

}



I hope that point you in the right direction,

~Ilan

Wick3dParticle
05-18-2010, 08:10 PM
im assuming you mean when your rocks come to a stop? If so you need to kill velocity on your particles once a "rest" state has been met.
//runtime
if (velocity <=.01)
velocity = 0;


EDIT: whoops - when I used the "if velocity..." condition, I ran in to an issue where it continues to jitter for some reason. So I tend to go with the event counter instead.

johnnymr75
05-18-2010, 08:28 PM
thanx so much guys, Ilan ur technique seems to work fine, mandark, I kept getting the jittering motion when i called out the velocity of the particles. i dont know why, although it makes sense.

thanx guys

noticeus
05-19-2010, 02:00 PM
well, I guess your offset settings on your collision object are too high, therefore you get the jittery movement.

The offset attribute is sort of strange in maya ( please correct me if I'm wrong) but the offset does not what you think it should do. The offset in maya works like a push out after collision which means your particle collides with the surface (direct contact) and then pushes the particle out according to the offset value on the geo connector. therefore if gravity still affects the particle after collision it moves down till it collides again with the surface and get pushed out again. result is your jittery movement.

the easiest solution in the gravity case would be to create a per particle gravity magnitude attribute and set the gravity to 0 after your first collision. this is a special case of course. so you wont get any bouncing effects. for that you'll need the event counter as mentioned above.

hope this helps to understand the offset attribute.

CGTalk Moderation
05-19-2010, 02:00 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.