How to determine Normal Vector of two colliding edges?

In summary, the conversation discusses the determination of the normal vector for two colliding edges in a physics simulation of rigid bodies. The experts suggest attaching a coordinate system and using the perpendicular lines to determine the normal vector. They also mention the use of SAT (Separating Axis Theorem) to check for collisions and obtain the collision normal. The conversation also includes a link to a proof and a simulation of the concept being discussed.
  • #1
danong
47
0
I am writing a physics simulation about the collision and reaction of the Rigid Body.
And now i have problem in determining the normal vector of two colliding edges.

For example,
I have 2 rectangulars ( whether or not it's of same size, anything can happens ),
and under some situations, they rotate and translate.
And finally, they come to contact each other with their edges.
How do i determine their refraction vector / normal vector correspondingly?

Just as shown as below :
/A/\B\

Thanks in advance.
 
Mathematics news on Phys.org
  • #2
just attach a coordinate system to one of the "rectangulars", the line perpendicular to each face is the normal. of course you can do that for each "rectangular" but to talk about them both at the same time is pointless.

if you don't understand what I am saying then just imagine that one of them is stationary, that it has a normal perpendicular to each face, and that the other block is approaching it.

hopefully you know how to code that because i don't but i would be interested in seeing your program+source
 
  • #3
mmm.. thanks for ur reply.
but sry, I'm having problem in edge normal not face normal.
or rather it would be vertices versus vertices normal.
hope it's clear =)
 
  • #4
For an edge edge collision you find two points, one on the first edge and one on the second one so that the distance between them is minimal (it's easier than it sounds). The vector between those points is the collision normal.
But by the way, how do you check to see if you have an edge-edge collision? When I implemented something like this a while ago I used the SAT (google it) to tell if boxes where colliding. The cool thing is that after checking for collision you can use the collision axis (you'll read about that when you google for SAT) to get the collision normal for free.
 
  • #5
daniel_i_l said:
For an edge edge collision you find two points, one on the first edge and one on the second one so that the distance between them is minimal (it's easier than it sounds). The vector between those points is the collision normal.
But by the way, how do you check to see if you have an edge-edge collision? When I implemented something like this a while ago I used the SAT (google it) to tell if boxes where colliding. The cool thing is that after checking for collision you can use the collision axis (you'll read about that when you google for SAT) to get the collision normal for free.

that is just the line orthogonal to both vertices. i actually just solve this problem recently. but it doesn't make sense to me as far as using it to apply some snell's law of relfection analogue or something
 
  • #6
Yes, u guys are so right, it reminds me of the basic principle of normal vector.
It's the matter of vector of colliding points.
I got a proof from here:
http://www.cescg.org/CESCG-2000/PSovis/index.html

Btw, i found a new interesting & difficulty of implementing this,
that's how to actually find the difference of two colliding points seem they are actually the same exact point.
Well, umm my guess for my own way would be detecting them in a small increment of timer and when they come close enough, for a measurement of about < 0.1 distance, then i assume it's colliding.
Well that's the computing way =/
I'm not dealing with 3D simulation anyway, just my first implementation on rigid,
and I'm writing it on flash as it's just for my trial.
Will post it after i got it implemented and try for a 3d version with c++.
Bravo!
 
  • #7
As promised, I've done my research and had applied it.
http://www.geocities.com/papaonn/RigidBodyDynamic.swf
It's just my first trial and i didn't do a proper accurate collision detection,
so if the simulation get stucked, just simply click reset button to restore it.
 
Last edited:

1. How do you determine the normal vector of two colliding edges?

To determine the normal vector of two colliding edges, you must first find the cross product between the two edges. This will give you a vector that is perpendicular to both edges and represents the direction of the normal vector.

2. What is the purpose of finding the normal vector of two colliding edges?

The normal vector is important in collision detection and response algorithms. It helps to determine the direction of the force that should be applied to the objects involved in the collision to simulate realistic physics and movement.

3. Can the normal vector be calculated if the edges are not perpendicular?

Yes, the normal vector can still be calculated even if the two edges are not perpendicular. However, the resulting vector will not be a true normal vector and may not accurately represent the direction of the force applied during the collision. It is best to use perpendicular edges for more accurate results.

4. How do you handle cases where the edges are parallel or collinear?

In cases where the edges are parallel or collinear, the cross product of the two edges will result in a zero vector. This means that there is no normal vector and the objects are not colliding. It is important to handle these cases in collision detection algorithms to prevent false collisions from being detected.

5. Are there any alternate methods for determining the normal vector of two colliding edges?

Yes, there are other methods for determining the normal vector, such as using the dot product or using the slope of the edges. However, the cross product method is the most commonly used and is preferred for its accuracy and ease of implementation. It is important to choose the method that best suits your specific application.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
914
  • Astronomy and Astrophysics
Replies
3
Views
765
Replies
1
Views
987
  • Introductory Physics Homework Help
Replies
1
Views
349
  • Special and General Relativity
Replies
10
Views
3K
  • Special and General Relativity
2
Replies
60
Views
3K
  • Introductory Physics Homework Help
2
Replies
36
Views
2K
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
94
Back
Top