Previous | Next --- Slide 67 of 79
Back to Lecture Thumbnails
potato

It's cool to see such a quick way to determine if a point is in a traingle. I'm curious what exactly the check is to see if a point is within a specific half plane created by an edge.

oadrian96

Could you take the cross product between two vectors u (P0 P2) and v (P0 Q) vXu such that if the result is positive i.e. pointing out of the picture point P is to the right of vector u and if its negative then its to the left?

keenan

@oadrian96 Yep, that's a nice way to do it!

keenan

I should say that, eventually, you will also want to get other information out of this checkā€”in particular the so-called barycentric coordinates of the point. These can also be obtained via cross products, but you'll have to do a little more work... we'll talk about that more when we discuss texture mapping.

Alex

But also can't we just express a vector in the form y = mx+b, then plug in our point's x value and compare the outputted y to our point's y value? (accounting for edge cases and the direction of the vector)