# particle-cylinder response calculation

This topic is 4076 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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).

1. 1
Rutin
23
2. 2
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 15
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631757
• Total Posts
3002150
×