View Single Post
# 1 19-03-2014 , 05:21 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374

Delayed particle tracking

I'm trying to constrain a locator to a particle, but no matter what I attempt, the locator is always trailing the particle by one frame.

I have tried to use a normal expression of the type:
Code:
vector $position = `nParticle -at worldPosition -id 0 -q targetParticleShape`;

loc.translateX = $position.x;
loc.translateY = $position.y;
loc.translateZ = $position.z;
And I have tried putting the evaluation after dynamics by doing something like this in the particle expression Runtime after dynamics:
Code:
vector $partPos = targetParticleShape.position;
float $xPos = $partPos.x;
float $yPos = $partPos.y;
float $zPos = $partPos.z;

loc.translateX = $xPos;
loc.translateY = $yPos;
loc.translateZ = $zPos;
But they all come to the same thing... the locator is delayed by a frame and is not fully constrained to the particle position.

Basically if I pause the sim and evaluate the particle position query it comes out as a different value as the current translate of the locator. It must be possible to make these equal.

Any thoughts?


-stwert

Website - Blog - YouTube - Vimeo - Facebook - Twitter

-->How to Effectively Ask Questions on Forums<--