summaryrefslogtreecommitdiff
path: root/test/raytracer/matrix.h
blob: 5ab63b33c0f07b992006cffbe380735263aa1d1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 * mid;
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);