Previous | Next --- Slide 50 of 139
Back to Lecture Thumbnails
dawwctor

How exactly are points taken inside of pixels? Is there some sort of known mapping between a particular "pixel" and the actual continuous values for coordinates that it contains? Wouldn't this also differ depending on screen size and resolution?

prathikn

I don't think this algorithm generalizes across all situations (or I could be wrong) -- using P1-P0, P2-P1, P0-P2 may not work because we make an assumption on the direction of the edges, impacting the direction of the normal. After applying various transformations, I think that the normal may not always be pointing inside? Anyone have thoughts on this?

alexz

@prathikn As we can see here, p0, p1, p2 are in the counter-clockwise direction. In previous slides, we define dX_i = X_(i+1) - X_i. Therefore, if we follow this counter-clockwise direction. The fact that L0, L1, and L2 are all less than 0 would indicate that the sample point is inside the triangle.

But I'm wondering if we can always access these three points in the counter-clockwise direction such as the parameters given in some function in our assignments?

yilong

@alexz Given two points (e.g. P0 and P1), you can check if P0-P1-P2 are in CCW direction or in CW direction, by calculating the sign of the dot product of P0P2 and normal vector of P0P1. If P0-P1-P2 are in clockwise direction, then we can use P0-P2-P1 instead.