diff --git a/builds/draw.o b/builds/draw.o index 8f643b6..d50f2e3 100644 Binary files a/builds/draw.o and b/builds/draw.o differ diff --git a/builds/modifs.o b/builds/modifs.o index 230d5e2..3b2a010 100644 Binary files a/builds/modifs.o and b/builds/modifs.o differ diff --git a/fdf b/fdf index c137133..d8a68df 100755 Binary files a/fdf and b/fdf differ diff --git a/srcs/draw.c b/srcs/draw.c index be475a8..c661242 100644 --- a/srcs/draw.c +++ b/srcs/draw.c @@ -7,7 +7,6 @@ void draw_image(t_fdf *fdf) fdf->rad_x = fdf->rot_x * M_PI / 180; fdf->rad_y = fdf->rot_y * M_PI / 180; - //fdf->altitude *= (fdf->offset + fdf->zoom) / fdf->offset; i =-1; while (++i < fdf->img_size_y * fdf->img_sizel) *(unsigned int*)(fdf->img_addr + i) = 0; @@ -70,7 +69,8 @@ void draw_color_pixel(t_fdf *fdf, int new_x, int new_y, int z) int color; color = 0xffffff; - z = z / fdf->altitude; + z -= (z * fdf->zoom) / fdf->offset; + z /= fdf->altitude; if (z) { color = color ^ (((0xff / fdf->max_z) * z) << 8 ); diff --git a/srcs/modifs.c b/srcs/modifs.c index c06fd45..c382800 100644 --- a/srcs/modifs.c +++ b/srcs/modifs.c @@ -46,6 +46,7 @@ int *new_coordinates(t_fdf *fdf, int i, int j) y -= (fdf->map_size_y + fdf->zoom * fdf->map_height) / 2; // rotation z = fdf->map[j][i] * fdf->altitude; + z += (z * fdf->zoom) / fdf->offset; point[0] = x * cos(fdf->rad_x) + y * sin(fdf->rad_x); point[1] = y * cos(fdf->rad_x) - x * sin(fdf->rad_x); point[1] = point[1] * cos(fdf->rad_y) - -z * sin(fdf->rad_y);