Point-in-polygon test

Started by
12 comments, last by Andos 22 years ago
Yann L:
I don''t understand you code here:
if( Pt2dInTri(A, B, C, P) ) return(1);

What is the mathematical formula?
Like:
if bla bla bla return (1)

What does "p" do? It''s in the formula.
Advertisement
Hey at maby you could write an extension for me. The extension SDK can be found at the download section of www.clickteam.com
You know... I''m making games with the Multimedia Fusion program and people that can code in C or something can make extensions to that. Creating those extension shold be an easy task for you hardcore programmers. Try out the demo for MMF 1.5 You''ll love it. Then you can understand how extensions work.
Ahh. Forgot to explain what an extensions is... An extension for Multimedia Fusion is an object (.cox) file that can things that MMF can''t do.
quote:
I don't understand you code here:
if( Pt2dInTri(A, B, C, P) ) return(1);

It's just a function call to the Pt2dInTri() function I posted above.

quote:
What does "p" do? It's in the formula

P are the coordinates of the point you want to test, if it is in the quad or not.

quote:
What is the mathematical formula?
Like:
if bla bla bla return (1)

It's not that easy, I'm affraid. A point in polygon test is much too complex to be squeezed in a simple mathematical equation. It's an algorithm that requires lots of separate equations and conditional branching depending on their result. Can't put that into a single formula.

What programming language do you use ?

[Edit]
S1CA: very nice article. The timing tables are interesting, gave me some ideas to optimize my collision detection...

[edited by - Yann L on March 21, 2002 4:02:58 PM]

This topic is closed to new replies.

Advertisement