Vectors, angles and rotations oh my!

Started by
2 comments, last by adam17 20 years, 1 month ago
i am trying to implement collision response into my physics demo but something is stopping it from appearing real. for example when a box hits a wall at an angle it makes contact at one point and then rotates until it makes full contact on a plane. i was wondering how i need to go about it. i have an idea of how to find the angle of rotation but i cant figure out the equation. here is a diagram:

v1 = v2
p1, p2, p3

      _____   /p3
     /     \ /
p1___|__|__|/___p2
     \__|__/
       p4
 
sorry about the bad drawing but that is a circle. p1->p2 are two points that make up a line segment. i need to find the angle between p4, the center of the circle, and p3. any ideas?
Advertisement
The physical response to hitting a wall is much like a beam of light hitting the wall. It will reflect at an angle equal to the angle it hit.

  \ 40 /70 \  / 70____\/____ 


So if it hits at an angle of 70 degrees it will reflect at an angle of 70 degrees.

---
K-1 Productions: Come visit us here.

[edited by - K-1 on March 23, 2004 8:33:59 AM]
---K-1 Productions: Come visit us here.
It may seem counter-intuitive But K-1''s answer is right even if it impacts off-center. If you''re handeling rotation seperatly then you can assume that the impact force is applied at the center of gravity.

Hint : Rotational force is that cross product of the vector from the object''s center of gravity to the impact point and the vector of the impact force. (Don''t normalize these. Their magnitudes are important.)

But it sounds like you''ve got that part already.

I think you want this

F = 2*N+I
where F is final vector
N is the Normal to plane
and I is the Initial Vector

or
Fx=2(-Ix*Nx'')*Nx''+Ix
Fy=2(-Iy*Ny'')*Ny''+Iy

to get N''
use Nx'' = Ix/sqrt((-Iy)*(-Iy)+Ix*Ix)

and repeat for Ny''

I barely understand it myself maybe worth a try though

This topic is closed to new replies.

Advertisement