• Advertisement

Archived

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

Collision Detection

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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!

Share this post


Link to post
Share on other sites

  • Advertisement