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 dz;
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
int slope_big;
|
|
||||||
int slope_small;
|
|
||||||
int pixel;
|
|
||||||
int z;
|
|
||||||
|
|
||||||
if (end)
|
if (end)
|
||||||
{
|
{
|
||||||
@@ -31,7 +27,7 @@ void draw_lines(t_fdf *fdf, int *start, int *end)
|
|||||||
//dz = end[2] - start[2];
|
//dz = end[2] - start[2];
|
||||||
i = 0;
|
i = 0;
|
||||||
j = 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]);
|
draw_color_pixel(fdf, start[0] + i, start[1] + j, start[2]);
|
||||||
if (j < i * dy / dx)
|
if (j < i * dy / dx)
|
||||||
@@ -39,26 +35,10 @@ void draw_lines(t_fdf *fdf, int *start, int *end)
|
|||||||
else
|
else
|
||||||
i++;
|
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)dx;
|
||||||
(void)dy;
|
(void)dy;
|
||||||
(void)dz;
|
(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
|
// point[0], point[1], point[2] -> new x, new y, new z
|
||||||
|
|||||||
Reference in New Issue
Block a user