-
Notifications
You must be signed in to change notification settings - Fork 0
/
point_to_paint.c
70 lines (64 loc) · 2 KB
/
point_to_paint.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
62
63
64
65
66
67
68
69
70
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* point_to_paint.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dholiday <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/08/13 13:53:13 by dholiday #+# #+# */
/* Updated: 2019/08/29 17:52:20 by dholiday ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void ft_open_win(t_ptr *im, t_map *fdf)
{
ft_default(fdf);
fdf->top = 16776960;
fdf->bottom = 16711680;
fdf->wind = cos(fdf->alpha) * ((fdf->line) +
fdf->max_collumn) * 10 * fdf->scale;
fdf->high = (fdf->max_high_positive - fdf->max_high_negative) / 100 *
fdf->scale_z + sin(fdf->alpha) *
((fdf->line) + fdf->max_collumn) * 10 * fdf->scale;
im->mlx_ptr = mlx_init();
if (fdf->wind > 1500)
fdf->wind = 1500;
if (fdf->high > 1500)
fdf->high = 1500;
if (fdf->high < 223)
fdf->high = 245;
im->win_ptr = mlx_new_window(im->mlx_ptr, 451 + fdf->wind * 2,
fdf->high * 2 + 50, "hello, my friend!!!");
}
void ft_print(t_map *fdf)
{
int ii;
int jj;
ii = 0;
while (ii < fdf->line)
{
jj = 1;
while (jj < fdf->mapi[ii][0].x)
{
ft_printf("%3d,", fdf->mapi[ii][(jj)].x / 1000);
ft_printf("%3d,", fdf->mapi[ii][(jj)].y / 1000);
ft_printf("%3d || ", fdf->mapi[ii][(jj)].z / 1000);
jj++;
}
ft_printf("\n");
ii++;
}
ft_printf("scale_z = %f\n\n", fdf->scale_z);
}
void ft_clean(t_map *fdf, int n)
{
int i;
int j;
i = 0;
while (i < n)
{
free(fdf->mapi[i]);
i++;
}
free(fdf->mapi);
}