PDA

View Full Version : nParticles - problem with rotation in midflight


avillabon
04-27-2010, 04:59 PM
I created an nparticle emitter for debris pieces which i have instanced. What i would like to set is for the value of rotPP to be proportional to the particle's speed, meaning that when the particle's velocity is 0 then rotPP will equal 0 as well.

So far I only have a couple of expressions attached to this particle system.

Creation Expressions:
Index (to controls the instancers' geo)
rotPP (emits particles at a random rotation position)
Debris_nParticleShape1.index = Debris_nParticleShape1.particleId%15;
Debris_nParticleShape1.rotPP = rand (0,360);

Runtime Expressions: (whic are the ones giving me a hard time)
float $vel = (Debris_nParticleShape1.velocity)/2000;
Debris_nParticleShape1.rotPP += $vel;
For some reason this isnt giving me any rotation while the particles are in flight which is the one thing i need right now.

I'll attach the scene so you can better see what is going on..

Thanks!

Alex

animatedfox
04-27-2010, 05:20 PM
While I don't have 2011 yet...and haven't gotten into the glorious new rotPP abilities. But something that may help is to make sure you are using velocity as a vector.
(Also rotPP is probably a vector as well.)

As for using your velocity, I think you may not need to divide it by quite as big a number (2000).
If you want to scale it, I would recommend maybe multiplying it by .5 or something like that.

A great way to problem solve your math is to use the numeric display type.
You can see how your values are changing...if at all.

Hopefully this helps...sorry if I am posting out of place due to my lack of actual 2011 rotPP experience.
~Ben

goin
04-27-2010, 05:39 PM
to make the particles stop on the ground try:

float $vel = Debris_nParticleShape1.velocity;
int $velInt = $vel;
if ($velInt > 0){
$vel = $vel * 20;
}
else{
$vel = 0;
}
Debris_nParticleShape1.rotPP += $vel;


Cheers, Ingo

avillabon
04-27-2010, 05:41 PM
Works now...

changed the runtime expressions to

float $vel = (Debris_nParticleShape1.velocity)*40;
Debris_nParticleShape1.rotPP = $vel;

Alex

CGTalk Moderation
04-27-2010, 05:41 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.