istereo

view libs/vmath/ray_c.c @ 34:634c7f7c1f0f

the text blur distance was too much man
author John Tsiombikas <nuclear@mutantstargoat.com>
date Fri, 09 Sep 2011 00:31:54 +0300
parents
children ff055bff6a15
line source
1 #include "ray.h"
2 #include "vector.h"
4 ray_t ray_transform(ray_t r, mat4_t xform)
5 {
6 mat4_t upper;
7 vec3_t dir;
9 m4_copy(upper, xform);
10 upper[0][3] = upper[1][3] = upper[2][3] = upper[3][0] = upper[3][1] = upper[3][2] = 0.0;
11 upper[3][3] = 1.0;
13 dir = v3_sub(r.dir, r.origin);
14 dir = v3_transform(dir, upper);
15 r.origin = v3_transform(r.origin, xform);
16 r.dir = v3_add(dir, r.origin);
17 return r;
18 }