Finding a point within a triangle...?
Ok, I''ve got a really simple question. I have four points (x,y), three form the verticies of a triangle and a forth is the location of a "player" How can i find if the forth point lies within the triangle formed by the first three?
Duckbob
Know the winding of the triangle segments (counter-clockwise or clockwise) to begin with. In a clockwise winding, if the point is to the left of any of the segments, it is outside. If it survives all three tests, that is, it is NOT to the left, then the point is inside.
If the signed area * 2 of the triangle defined by the line segment A - B and the point P is > 0.0, then P is to the left of the line segment A - B. Pass the args in as P, A, B.
![](http://www.bryan.1-sh.com/gallery/images/banner2.JPG)
Edited by - bishop_pass on June 1, 2001 2:58:29 AM
If the signed area * 2 of the triangle defined by the line segment A - B and the point P is > 0.0, then P is to the left of the line segment A - B. Pass the args in as P, A, B.
|
Edited by - bishop_pass on June 1, 2001 2:58:29 AM
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
It mangled my macro. I do not understand why it would do something so inept as that. It''s supposed to render source code, which means don''t do anything to the text, but it has to go and do crap to it.
Unbelievable.
Unbelievable.
_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement