-
Notifications
You must be signed in to change notification settings - Fork 0
/
frame.c
61 lines (56 loc) · 2.23 KB
/
frame.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
57
58
59
60
61
/* ************************************************************************** */
/* LE - / */
/* / */
/* frame.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: bpajot <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2018/01/04 16:03:04 by bpajot #+# ## ## #+# */
/* Updated: 2018/01/04 17:30:58 by bpajot ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include "fdf.h"
static void display_x(t_all *all)
{
all->line.x1 = all->e.width - 150;
all->line.y1 = all->e.height - 150;
all->line.x2 = all->line.x1 + sqrt(2) / 2 * 100 * (cos(all->size.rot_z *
M_PI / 180) + sin(all->size.rot_z * M_PI / 180));
all->line.y2 = all->line.y1 + 1 / sqrt(6) * 100 * (cos(all->size.rot_z *
M_PI / 180) - sin(all->size.rot_z * M_PI / 180));
all->line.color1 = 0xFF0000;
all->line.color2 = 0xFF0000;
ft_line(all);
}
static void display_y(t_all *all)
{
all->line.x1 = all->e.width - 150;
all->line.y1 = all->e.height - 150;
all->line.x2 = all->line.x1 + sqrt(2) / 2 * 100 * (-cos(all->size.rot_z *
M_PI / 180) + sin(all->size.rot_z * M_PI / 180));
all->line.y2 = all->line.y1 + 1 / sqrt(6) * 100 * (cos(all->size.rot_z *
M_PI / 180) + sin(all->size.rot_z * M_PI / 180));
all->line.color1 = 0xFF00;
all->line.color2 = 0xFF00;
ft_line(all);
}
static void display_z(t_all *all)
{
all->line.x1 = all->e.width - 150;
all->line.y1 = all->e.height - 150;
all->line.x2 = all->line.x1;
all->line.y2 = all->line.y1 - sqrt(2.0 / 3.0) * 100;
all->line.color1 = 0xFF;
all->line.color2 = 0xFF;
ft_line(all);
}
void display_frame(t_all *all)
{
if (all->e.width == 2400 && all->e.height >= 1200)
{
display_z(all);
display_x(all);
display_y(all);
}
}