Archived

This topic is now archived and is closed to further replies.

Collision Detection

This topic is 6711 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

How to know the smaller distance between a line segment and a point? I need it to make my collision detection! Thanks, Arthur(rockslave)

Share on other sites
ola!
first, you get one point from the line segment (one of the extremes).
then you get the vector that goes from that point of the line segment to the other point you want to know the distance(let''s call it a).
now you make the projection of that vector over the line vector.
(call it b)
know you use h^2 = c1^2 + c2^2, where h is the length of a and c1 is the length of b.
c2=sqrt( h2^2-c1^2 )

Share on other sites
Ha! Será que podemos falar português nesse forum? Obrigado pela esplicação! Vou copiá-la e estudá-la em casa! Valeu!

Thanks, Arthur(rockslave)

Share on other sites
Sim. Eu so pensei q pudessem reclamar com a gente por estar-mos a falar portugues. A maior parte do pessoal so fala ingles!

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• Forum Statistics

• Total Topics
633298
• Total Posts
3011256
• Who's Online (See full list)

There are no registered users currently online

×