should be testing with '<=' so that we also draw edge pixels
'< 0' gives us pixels inside the triangle. '== 0' gives us pixels on the edges of the triangle
This commit is contained in:
parent
2280578904
commit
49a8b23568
|
@ -57,7 +57,7 @@ pub fn per_pixel_triangle_2d<PixelType: Pixel>(
|
||||||
for pixel in row_pixels.iter_mut() {
|
for pixel in row_pixels.iter_mut() {
|
||||||
// note that for a counter-clockwise vertex winding order with the direction of Y+ going down instead
|
// note that for a counter-clockwise vertex winding order with the direction of Y+ going down instead
|
||||||
// of up, we need to test for *negative* area when checking if we're inside the triangle
|
// of up, we need to test for *negative* area when checking if we're inside the triangle
|
||||||
if w0 < 0.0 && w1 < 0.0 && w2 < 0.0 {
|
if w0 <= 0.0 && w1 <= 0.0 && w2 <= 0.0 {
|
||||||
pixel_fn(pixel, w0, w1, w2);
|
pixel_fn(pixel, w0, w1, w2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue