PDA

View Full Version : Particles that die on contact with a surface ?



andy gee
03-20-2008, 04:38 PM
Hi everybody

I have a question regarding maya particles.

Ok I have a scene with a swimming fish (my great white shark)
I have created a particle emitter which uses instances of a soft body nurbs sphere to simulate bubbles.

I have placed this just below the camera and parented it to the camera so it will move where the camera moves.

Its to give the impression of somebody breathing underwater.

Ok I have created an expression that will kill any particles that rise above the water line so that maya doesn't get bogged down with tones of geomtry.

Ok the problem is... My camera moves quickly when the shark attacks (camera moves backwards very quickly) and in turn the bubbles get sucked into his mouth. Now I have added the shark geometry to collide with the bubble particles so the bubbles gather inside his mouth as he swims.

Now is there a way or expression I could write that will say to the particles. You must die when you touch this surface ??

I have tried the following to sort this problem out, I have increased the speed of the particles towards the end of the animation so that the particles move up over the snout instead of in his mouth.

Also I have tried adding an air field inside the sharks mouth so that it will blow out the bubbles so they dont get too many.

But is there a way to have the exra particles die on contact with the surface ??

if anybody can help that would be great.

thanks

Andy Gee

johnny
03-20-2008, 07:13 PM
Hey Andy, I have needed to use this expression before although it didn't work for my scenario but it should work for you. Maya keeps collision data inside the collision U and V atts. of the particles node. Add these as any other attr.

Particle >> attr editor >> add attr >> general >> particle tab >> collision U and V.

You must also use lifespanPP as the particle lifespan. You can then use those in the expression to kill them off upon collision. I cant remember what value collision have after collision without testning it out, but I think its 1. Also this must be run frame to frame (maybe after dynamics in your case).