zoom fonctionne meme en z

This commit is contained in:
hugogogo
2021-07-23 15:27:22 +02:00
parent b9f02a20f3
commit 04ad40b58d
5 changed files with 3 additions and 2 deletions

View File

@@ -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);