Sign in to follow this  
noviceprogmr84

particle-cylinder response calculation

Recommended Posts

a little background. ive been programming for about a year right now, and right now am in the middle of an attempt to simulate the introduction of particles into a vacuum chamber using OpenGL. The particles must be introduced through a nozzle, which is represented by a cylinder with a radius of 0.3 enclosed by a disc at one end. Ive been able to do the easy job of collision detection, using the radius of a line running through the center of the cylinder as a basis, as well as the z coordinate of 0 of the disc as a collision point. My main problem is determining the necessary collision response on a curved surface as i am certainly a novice in this area. any help from anybody that's done this before or something?

Share this post


Link to post
Share on other sites
Imagine this in 2 dimensions first:

On a circle each point p has a tangent line that is perpendicular to the vector from the origin to p, and each tangent line has a normal vector pn which is the unit vector pointing from p to the origin. If a particle collides with the circle at p0 we could simply reflect the particle's velocity around pn. Let's say v0 is the particle's initial velocity, and vf is the particle's velocity after the collision, then

vf = v0 - 2 * pn * (pn DOT v0)

That's just a simple reflection operation, reflecting v0 around pn. This should get a particle bouncing around inside a circle. A cylinder is just the same thing only with many circles stacked on top of each other. The only difference will be that pn points from the point of contact to the closest point on the about which the cylinder is oriented. If a particle hits the cap of the cylinder you can just reflect it's velocity around the cap's normal vector (a unit vector perpendicular to the cap).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this