Assume an object move toward a polygon board in 3D field . In order to detect whether the object collide in the board , according to the lecture notes of my Computer Graphics Course lecturer - it should to check the following -
- Draw lines from the point to the vertices of the polygon
- Calculate the sum of angles between the lines
- If the sum is 360˚ then the point is on the polygon
These steps are simple and clearly , but when I performed that in OpenGL I noticed that the above
sum of angles can mislead us a little , for example -
In a case that the board in a rectangle of 1x1 meter size , 350˚ angel value say that the object is almost collide in the board , but in another smaller board say - 0.005x0.005 meter - 350˚ angel say that there is some relative distance until the collision .
The question is - how could I achieve an - normalized angel value - which taking into account the board size ?