-
Notifications
You must be signed in to change notification settings - Fork 0
/
map_transformations.c
56 lines (49 loc) · 1.47 KB
/
map_transformations.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* map_transformations.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: etachott <etachott@student.42sp.org.br> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/07 17:41:36 by etachott #+# #+# */
/* Updated: 2022/11/07 17:41:38 by etachott ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void extrude(t_map_values *pos)
{
pos->y = pos->y + pos->z;
}
void rotate(t_map_values *pos)
{
int x;
int y;
x = (pos->x * 1) + (pos->y * 1);
y = (pos->x * 1) + (pos->y * -1);
pos->x = x - (WIDTH * 1.4) / 4;
pos->y = y - (HEIGHT * 1.5) / 4;
}
void down(t_map_values *pos)
{
pos->y /= 2;
}
void scale(t_map_values **map, int *scale_value)
{
int x;
int y;
x = 0;
while (map[x])
{
y = 0;
while (map[x] + y)
{
map[x][y].x *= *scale_value;
map[x][y].y *= *scale_value;
map[x][y].z *= *scale_value / 2;
if ((map[x] + y)->eol)
break ;
y++;
}
x++;
}
}