tjrs en amelioration du dessin des lignes
This commit is contained in:
BIN
builds/fdf.o
BIN
builds/fdf.o
Binary file not shown.
22
srcs/fdf.c
22
srcs/fdf.c
@@ -19,10 +19,6 @@ void draw_lines(t_fdf *fdf, int *start, int *end)
|
||||
int dz;
|
||||
int i;
|
||||
int j;
|
||||
int slope_big;
|
||||
int slope_small;
|
||||
int pixel;
|
||||
int z;
|
||||
|
||||
if (end)
|
||||
{
|
||||
@@ -31,7 +27,7 @@ void draw_lines(t_fdf *fdf, int *start, int *end)
|
||||
//dz = end[2] - start[2];
|
||||
i = 0;
|
||||
j = 0;
|
||||
while (i < dx && j < dy)
|
||||
while (i <= dx && j <= dy)
|
||||
{
|
||||
draw_color_pixel(fdf, start[0] + i, start[1] + j, start[2]);
|
||||
if (j < i * dy / dx)
|
||||
@@ -39,26 +35,10 @@ void draw_lines(t_fdf *fdf, int *start, int *end)
|
||||
else
|
||||
i++;
|
||||
}
|
||||
/*
|
||||
slope_big = ft_greater(ft_absolute(dx), ft_absolute(dy));
|
||||
slope_small = ft_smaller(ft_absolute(dx), ft_absolute(dy));
|
||||
i = 0;
|
||||
while (++i <= slope_big)
|
||||
{
|
||||
pixel = slope_small / slope_big * i * ft_sign(dx);
|
||||
z = start[3] + (dz / slope_big * i);
|
||||
draw_color_pixel(fdf, start[0] + i, start[1] + pixel, z);
|
||||
}
|
||||
*/
|
||||
}
|
||||
(void)dx;
|
||||
(void)dy;
|
||||
(void)dz;
|
||||
(void)slope_big;
|
||||
(void)slope_small;
|
||||
(void)i;
|
||||
(void)pixel;
|
||||
(void)z;
|
||||
}
|
||||
|
||||
// point[0], point[1], point[2] -> new x, new y, new z
|
||||
|
||||
Reference in New Issue
Block a user