How to determine Normal Vector of two colliding edges?

  • Thread starter Thread starter danong
  • Start date Start date
  • Tags Tags
    Normal Vector
Click For Summary
Determining the normal vector for colliding edges in a physics simulation involves identifying two points on the edges that are closest together, with the vector between these points serving as the collision normal. The Separating Axis Theorem (SAT) can be utilized to check for edge-edge collisions and derive the collision normal. When edges are nearly overlapping, detecting collisions can be challenging, and a method of measuring proximity over small time increments may be effective. The discussion also highlights the importance of understanding the basic principles of normal vectors in collision detection. The user plans to implement these concepts in a Flash simulation and eventually transition to a 3D version in C++.
danong
Messages
43
Reaction score
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
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
 
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 =)
 
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.
 
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
 
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!
 
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:

Similar threads

Replies
26
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
4
Views
2K