-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathb_calc_coordinate_bonus.c
28 lines (25 loc) · 1.21 KB
/
b_calc_coordinate_bonus.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* b_calc_coordinate_bonus.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nkawaguc <nkawaguc@student.42tokyo.jp> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/29 19:49:03 by nkawaguc #+# #+# */
/* Updated: 2024/10/29 19:49:07 by nkawaguc ### ########.fr */
/* */
/* ************************************************************************** */
#include "b_fdf_bonus.h"
void calc_coordinate(t_data *data, t_map *map, int i, int j)
{
double pos[3];
pos[0] = j;
pos[1] = i;
pos[2] = map->data[i][j];
rotate_z(pos, data->rotate_z);
rotate_y(pos, data->rotate_y);
rotate_x(pos, data->rotate_x);
map->points[i][j].x = pos[0];
map->points[i][j].y = pos[1];
map->points[i][j].z = pos[2];
}