rotation centree fonctionne
This commit is contained in:
BIN
builds/fdf.o
BIN
builds/fdf.o
Binary file not shown.
10
srcs/fdf.c
10
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user