PDA

View Full Version : Getting the velocity inherited from surface emitter?


ctp
07-13-2006, 05:47 PM
I have a surface emitter and have set the particles to inherit some of the surface velocity by using the inherit factor on the particleShape. The particles are also affected by some random emisson speed and turbulence fields.

What I'd like to be able to access per particle (in an expression) is out of the total velocity they are given at creation, what velocity do they inherit from the surface.

Is there a way to query this?

Cheers.

vfortin
07-17-2006, 03:29 PM
Hi,

This should be doable...

Set your emission speed to any value (1 for example) and have randomSpeed to zero so each particle get the same emission speed. That way you keep your normal vector.

Then in a creation expression you should be able to retrieve the inherited velocity by substracting the
emission speed from the current velocity.
Afterward simply add you own emission speed if you want.

I think any velocity generated by the turbulence fields are not calculated in the creation expression anyway so you shouldn't have to worry about them.

Cheers!

ctp
07-17-2006, 11:33 PM
Excellent! You are right vfortin!
Funny thing is though, with a turbulence connected to the particles and no emission speed, if you choose to print eg. the velocity from the creation expression and at the same time have the particle type set to numeric readout of velocity, you will see that when the particle is created it does have velocity from the turbulence - if you take it from the viewport readout - but the print from the creation expression says velocity is zero.

Great thing is, a creation expression does pick up on inherited velocity. So just adding any random velocity afterwards in creation will give me what I want.

Thanks!

drGonzo
07-18-2006, 07:18 AM
Check out:
"Scaling emission rate based on emitter speed" at http://www.tokeru.com/twiki/bin/view/Main/MayaParticles

Could be helpful for your purposes.

vfortin
07-18-2006, 12:56 PM
Thanks for the link drGonzo!

ctp: Glad it worked! I just realized that if you'd have entered any value for speed, your vector would have been perturbed by the normal speed. Assuming your emitter's normals were not all pointing in the same direction, it'd possibly have been impossible to substract the exact velocity inherited from the emitter object because each particle would now have its own normal direction. However it'd still work with the speed ;-)

The numerical display feature evaluates the velocity after the simulation which is obviously not the case with the creation expression. You could simply make it display your own custom attribute.

Cheers!

ctp
08-11-2006, 09:01 AM
Hmmmm.... now I'm in the situation vfortin mentioned last... and I'd like know not only the inherited velocity per particle but also the normal of the geometry at the point where the particle is emitted. I'm emitting from a polygon softbody affected by fields, so the mesh is changing shape over time.

Anybody...?

vfortin
08-11-2006, 01:37 PM
Hi again!
Unfortunately, such an attribute doesn't exist for particles.
However, the PointOnSurface command can return the normal of a given point on your mesh but I have yet to find a way to retrieve the closest vertex from the particle.
Also if you work with Maya7, there's a new PP Goal attribute that'll read the current normal. Goals are getting more powerful than ever. Not sure how possible it'd be to adapt your particle setup to make them 'emit' from goal though.
My 2 cents ;-)

CGTalk Moderation
08-11-2006, 01:37 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.