rotation foncitonne jusque 180 deg

This commit is contained in:
hugogogo
2021-07-22 20:10:22 +02:00
parent 34e2e5576f
commit 14179207ba
3 changed files with 3 additions and 3 deletions

View File

@@ -27,15 +27,15 @@ void draw_lines(t_fdf *fdf, int *start, int *end)
i = 0;
j = 0;
z = start[2];
while (i <= dx && j <= dy)
while (ft_abs(i) <= ft_abs(dx) && ft_abs(j) <= ft_abs(dy))
{
if ((dx + dy) && (i + j))
z = start[2] + (end[2] - start[2]) * (i + j) / (dx + dy);
draw_color_pixel(fdf, start[0] + i, start[1] + j, z);
if (!dx || j < i * dy / dx)
j++;
j += ft_sign(dy);
else
i++;
i += ft_sign(dx);
}
}
}