Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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 -

  1. Draw lines from the point to the vertices of the polygon
  2. Calculate the sum of angles between the lines
  3. 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 ?

share|improve this question
I'm having trouble visualising the problem. Which angles do you add? Is there somewhere I can read about this? –  Anko Sep 17 '13 at 7:20
you can read about that here in page 4 –  URL87 Sep 17 '13 at 12:04
I think you are misunderstanding the algorithm. The slides you linked to also seemed misleading. When using the angle algorithm, you should always end up with a multiple of 360˚. This is because you need to use the correct sign for the angle. Wikipedia has a better explanation. If implemented correctly, there should be no need for normalization. –  MooseBoys Oct 2 '13 at 20:48
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.