# nParticle Fill Object Jitter Problem

09 September 2013   #1
nParticle Fill Object Jitter Problem

Hi everyone.

I do have to fill glas-object, lets say like a small aquarium with small cylinders.
Because of the large amount of objects I have to pour in my object I am using nParticles and I instance the cylinders.

My Problem is that the lower nParticles at the bottom of the aquarium keep on jittering and rotating, although there is no visible or logical dynamic force upon them.

Duncan posted a similar scene here:
which perfectly shows my problem. Cache the scene and hide the cube and you will notice all the little tori jitter like hell.

What I tried so far:
I tried adjusting all dynamic attributes I could think of, friction, bounciness, damping whatever, with no satisfying results.

Next step I dived into scripting:
I added two attributes per Particle:
nParticleShape1.positionLastFrame (vector) and
nParticleShape1.rotateLastFrame (vector).

By setting these attributes in the expression before dynamics to the value of current position and rotation, I am able to refer to these values to the position and rotation AFTER dynamics:

Before Dynamics:
``````nParticleShape1.positionLastFrame = nParticleShape1.position;
nParticleShape1.rotateLastFrame = nParticleShape1.rotationPP;
``````

After Dynamics I simply summed x,y and z velocity and checked if this sum is larger than a specific value I played around with.
If the velocity is rather small, I set the position and the rotation of the particles after Dynamics to the values before dynamics :

expression after dynamics
``````vector \$currentVelocity = nParticleShape1.velocity;
float \$SummeVelocity = \$currentVelocity.x + \$currentVelocity.y + \$currentVelocity.z;

//make sure I get a positive value. There should be better ways, I was too lazy to find them.
if (\$SummeVelocity < 0)
{
\$SummeVelocity = \$SummeVelocity *(-1);
}

if (\$SummeVelocity < .2)
{
nParticleShape1.rotationPP = nParticleShape1.rotateLastFrame;
nParticleShape1.position = nParticleShape1.positionLastFrame;
}

``````

This works, well, OK. I could go with it (good enough design ...), but here are my questions:
Has anyone solved this problem, maybe in a more elegant way ?
Did I miss something? I mean, obviously particles that do not move somehow get velocity. Can I stop this?
Can I make the upper nParticles absorb the dynamics, so the lower ones just stay calm, neat and quiet ?
Does anyone understand my questions ?

I attached my current scene, if someone wants to have a look.

Have a lovely weekend !
Attached Files
 Jittering.zip (8.8 KB, 4 views)

Last edited by edtheknife : 09 September 2013 at 09:21 AM. Reason: more small mistakes

 09 September 2013 #2 mandark1011 Expert   portfolio Michael Lemon Fx Artist Canada   Join Date: Apr 2003 Posts: 1,042 I have always considered this kind of problem to be related to trap checking on your particle object. Basically there is interpenetration and the trap check is trying to solve for this with a slight outward push. could be that if you played with these settings you could get a better result or try upping the subsampling in your nucleus node. just guesses but ive run into this plenty of times before. good luck __________________ Showreel RnD share quote
 09 September 2013 #3 CGTalk Moderation Expert   Join Date: Sep 2003 Posts: 1,066,473 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. share quote

 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 vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.