-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_axis.c
41 lines (38 loc) · 1.43 KB
/
ft_axis.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_axis.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: asibille <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/02/25 18:30:35 by asibille #+# #+# */
/* Updated: 2022/02/28 17:49:25 by asibille ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void ft_axis(t_data *fdf)
{
double x;
double y;
double z;
double max;
max = sqrt(HEIGHT * HEIGHT + WIDTH * WIDTH);
x = -1;
while (++x < max)
{
y = (x * sin(fdf->tx)) + fdf->oord;
my_mlx_pixel_put(fdf, (x * cos(fdf->tx)) + fdf->oabs, y, TURQUOISE);
}
y = -1;
while (++y < max)
{
x = (y * cos(fdf->ty)) + fdf->oabs;
my_mlx_pixel_put(fdf, x, (y * sin(fdf->ty)) + fdf->oord, TURQUOISE);
}
z = -1;
while (++z < max)
{
x = (z * cos(fdf->tz)) + fdf->oabs;
my_mlx_pixel_put(fdf, x, (z * sin(fdf->tz)) + fdf->oord, TURQUOISE);
}
}