diff --git a/builds/fdf.o b/builds/fdf.o index 49a32ee..1d658db 100644 Binary files a/builds/fdf.o and b/builds/fdf.o differ diff --git a/fdf b/fdf index 9b168f4..fcc8a96 100755 Binary files a/fdf and b/fdf differ diff --git a/srcs/fdf.c b/srcs/fdf.c index 360291c..ae2a574 100644 --- a/srcs/fdf.c +++ b/srcs/fdf.c @@ -44,14 +44,14 @@ void draw_image(t_fdf *fdf) while (++i < fdf->map_width) { - x = i * fdf->offset; - y = j * fdf->offset; + x = i * fdf->offset - (fdf->map_size_x / 2); + y = j * fdf->offset - (fdf->map_size_y / 2); z = fdf->map[j][i]; new_x = x * cos(fdf->rad_x) + y * sin(fdf->rad_x); new_y = y * cos(fdf->rad_x) - x * sin(fdf->rad_x); - new_y = new_y * cos(fdf->rad_y) - z * sin(fdf->rad_y); - new_x += fdf->margin + fdf->mov_x; - new_y += fdf->margin + fdf->mov_y; + new_y = new_y * cos(fdf->rad_y) - -z * sin(fdf->rad_y); + new_x += fdf->margin + fdf->mov_x + (fdf->map_size_x / 2); + new_y += fdf->margin + fdf->mov_y + (fdf->map_size_y / 2); color_altitude_pixel(fdf, new_x, new_y, z); } }