Calculating Velocity Vector After Polygon Collision - Madison

Click For Summary

Discussion Overview

The discussion revolves around calculating the resulting velocity vector of an object after it collides with a polygon in a 2-dimensional game environment. The focus is on deriving an equation that relates the velocity vector before the collision to the velocity vector after the collision, specifically in the context of a totally inelastic collision.

Discussion Character

  • Technical explanation, Mathematical reasoning, Debate/contested

Main Points Raised

  • Madison describes the challenge of determining the resulting velocity vector after a polygon collision, seeking an equation that relates the blue vector to the green vector based on known red points.
  • One participant questions the nature of the relationship between the blue and green vectors and seeks clarification on the physical situation being simulated.
  • Another participant explains that during the collision, the component of the object's velocity that is perpendicular to the edge of the polygon should be eliminated, allowing the object to continue along a path parallel to the edge.
  • A later reply suggests projecting the initial velocity vector onto the edge direction vector to obtain the final velocity vector, providing a specific mathematical formula for this projection.
  • Madison confirms that the provided equation worked perfectly for their needs.

Areas of Agreement / Disagreement

Participants generally agree on the approach of using vector projection for calculating the resulting velocity after the collision, although there was initial uncertainty regarding the specifics of the physical scenario being modeled.

Contextual Notes

There are assumptions regarding the availability of certain vectors and the ability to perform dot products, which may not be explicitly stated. The discussion does not resolve all potential complexities of collision dynamics.

Who May Find This Useful

Game developers, physics students, and anyone interested in collision detection and response in 2D environments may find this discussion relevant.

mbrown3391
Messages
6
Reaction score
0
I am currently programming a 2-dimensional game and am creating a class that will allow for collision detection with any polygon defined by a set of points. The actual collision detection was easy, however i am having trouble coming up with an equation to describe the resulting velocity vector of an object after the collision.

http://www.cheeseparade.com/diagram.png

Based on the diagram above, can anyone give me an equation that will return the blue vector as a function of the green vector, regardless of the angle of the green vector? All the red points are known information at any given time.

Thanks,
Madison
 
Last edited by a moderator:
Physics news on Phys.org
I'm not quite sure what I'm looking at here... what should the relationship be between the blue vector and green vector? Or in other words, what kind of physical situation are you trying to simulate? What happens to the object that collides with the polygon?
 
when the object collides, the component of its velocity that is perpendicular to the edge that it collides with should be eliminated so that the object continues on a path parallel to the edge. i don't need to worry about bouncing at this point.
 
OK, I see... you're talking about a totally inelastic collision. I'm assuming you have (or can calculate) the velocity vector [itex]\vec{v}[/itex] as well as the vector pointing along the edge of the polygon in the direction of the blue arrow, which I'll call [itex]\vec{p}[/itex], and also that you either have or can write a function to take dot products. Then you can just project [itex]\vec{v}[/itex] on to [itex]\vec{p}[/itex] to get your final velocity:
[tex]\vec{v}\,' = \frac{\vec{v}\cdot\vec{p}}{\vec{p}\cdot\vec{p}}\ \vec{p}[/tex]

Incidentally, a general formula for inelastic collisions can be found on Wikipedia, http://en.wikipedia.org/wiki/Coefficient_of_restitution.
 
Thank you! that equation worked perfectly.
 

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 35 ·
2
Replies
35
Views
4K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 30 ·
2
Replies
30
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
1
Views
8K