-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtekray.c
27 lines (25 loc) · 788 Bytes
/
tekray.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
/*
** tekray.c for tekray in /home/nicolas/Modules/gfx_raytracer1/tcore
**
** Made by menett_a
** Login <[email protected]>
**
** Started on Sun Feb 28 16:24:19 2016 menett_a
** Last update Sun Mar 13 21:33:58 2016 menett_a
*/
#include <lapin.h>
#include <math.h>
#include "struct.h"
void tekray(t_view *screen,
double *x,
double *y,
double *z)
{
*x = (screen->screen_info[0].x - screen->screen_info[1].x / 2)
* cos(screen->angle * M_PI / 180) + (600 / (2 * tan(30 / 2)))
* sin(screen->angle * M_PI / 180);
*y = (screen->screen_info[0].y - screen->screen_info[1].y / 2);
*z = (screen->screen_info[0].x - screen->screen_info[1].x / 2)
* sin(screen->angle * M_PI / 180) - (600 / (2 * tan(30 / 2)))
* cos(screen->angle * M_PI / 180);
}