#include <usercore.h>
#include <math.h>


rotate_in_z(theta,world_mat)
	float	theta;
	float	world_mat[4][4]; 
{
	float	mat[4][4]; 

	identity(mat);
	mat[0][0] = cos(theta);
	mat[1][1] = cos(theta);
	mat[0][1] = sin(theta);
	mat[1][0] = -mat[0][1];
	set_wcm(mat,world_mat);
}

rotate_in_y(theta,world_mat)
	float	theta;
	float	world_mat[4][4]; 
{
	float	mat[4][4]; 

	identity(mat);
	mat[0][0] = cos(theta);
	mat[2][2] = cos(theta);
	mat[2][0] = sin(theta);
	mat[0][2] = -mat[2][0];
	set_wcm(mat,world_mat);
}

rotate_in_x(theta,world_mat)
	float	theta;
	float	world_mat[4][4]; 
{
	float	mat[4][4]; 

	identity(mat);
	mat[1][1] = cos(theta);
	mat[2][2] = cos(theta);
	mat[1][2] = sin(theta);
	mat[2][1] = -mat[1][2];
	set_wcm(mat,world_mat);
}



/*
clr_wcm() {
	identity(world_mat);
}
*/

set_wcm(mat,world_mat)
	float	mat[4][4]; 
{
	float	tmp[4][4];

	mat_cp(world_mat, tmp);
	mat_mult(mat, tmp, world_mat);
}

