aboutsummaryrefslogtreecommitdiffstats
path: root/test/raytracer/matrix.h
blob: 4b9f4346eb0555a227a3f227f96b8962c8905561 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
struct matrix {
  flt xx, xy, xz, xt;
  flt yx, yy, yz, yt;
  flt zx, zy, zz, zt;
};

void apply_to_point(struct matrix * m, struct point * p,
                    /*out*/ struct point * r);
void apply_to_vect(struct matrix * m, struct vector * v,
                   /*out*/ struct vector * r);
extern struct matrix matrix_identity;
#define mid (&matrix_identity)
struct matrix * mtranslate(flt sx, flt sy, flt sz);
struct matrix * mscale(flt sx, flt sy, flt sz);
struct matrix * mrotatex(flt a);
struct matrix * mrotatey(flt a);
struct matrix * mrotatez(flt a);
struct matrix * mcompose(struct matrix * m, struct matrix * n);