Lecture 2: Rasterization (38)

The normal vector generated by this mean points "left" side of the original vector. In this case, we should take vertexes in counterclockwise order to get the vectors corresponding to every edge so that we can perform the Inside-Triangle test in the next pages correctly.

If we modify the equation as Perp(x, y) = (y, -x) just adopt clockwise order and the Inside-Triangle test would still work.


I understand that we can use the line equation on all three sides of a triangle to test whether a point is inside of the triangle, but I don't understand the derivation. How does using this perpendicular vector allow us to decide if a point is on a certain side of the line? And how do we know which side of the line is "inside" (i.e. if the point falls in the shaded orange area on the next few slides)?

You must be enrolled in the course to comment