sweet/exemple/exemple_matrix.c
2014-04-17 01:24:35 +02:00

31 lines
611 B
C

#include <stdio.h>
#include <stdlib.h>
#include "sweet.h"
void
print4 (mat4 * m)
{
printf ("%f %f %f %f\n", m->v[0], m->v[4], m->v[8], m->v[12]);
printf ("%f %f %f %f\n", m->v[1], m->v[5], m->v[9], m->v[13]);
printf ("%f %f %f %f\n", m->v[2], m->v[6], m->v[10], m->v[14]);
printf ("%f %f %f %f\n", m->v[3], m->v[7], m->v[11], m->v[15]);
printf ("\n");
}
int
main ()
{
mat4 m = sweet_matrix_rotation3h (SWEET_PI_OVER_2, 1.0, 1.0, 1.0);
print4 (&m);
sweet_matrix_inverse4 (&m, &m);
print4 (&m);
sweet_matrix_inverse4 (&m, &m);
print4 (&m);
return 0;
}