#include <fdf.h>

void	transform(t_mat4 *mat, t_map *map)
{
	int 	i;
	int 	j;

	i = 0;
	while (i < map->y_max)
	{
		j = 0;
		while (j < map->x_max)
		{
			vec_mat_mult(mat, &map->arr_vec[i][j], &map->arr_pnt[i][j]);
			j++;
		}
		i++;
	}
}

void	center(t_map *map)
{
	double 	d_x;
	double	d_y;
	double	d_z;
	int 	i;
	int 	j;

	d_x = map->x_max / 2.0f;
	d_y = map->y_max / 2.0f;
	d_z = map->z_max / 2.0f;
	i = 0;
	while (i < map->y_max)
	{
		j = 0;
		while (j < map->x_max)
		{
			map->arr_vec[i][j].z -= d_z;
			map->arr_vec[i][j].x -= d_x;
			map->arr_vec[i][j].y -= d_y;
			j++;
		}
		i++;
	}
}