#include <v_lib.h>
#include "../include/v_show.h"

void main()
{
	matrix3_t mat;
	vec3_t axis;
	vec_t angle;
	vec3_t dir={0,0,-1},up={0,1,0},right;
	vec3_t basis[3];
	vec3_t e1={1,0,0},e2={0,1,0},e3={0,0,1};
	
	logStartConsoleLog();
	
	vec3Cross(right,dir,up);
	
	/*
	showvec3(dir);
	showvec3(up);
	showvec3(right);
	puts("==============");
	*/

	vec3Set(axis,1,2,3);
	vec3Unit(axis,axis);
	angle=M_PI2;
	mat3Rotate(mat,axis,angle);
	showmat3(mat);
	
	mat3VecMul(basis[0],mat,e1);
	mat3VecMul(basis[1],mat,e2);
	mat3VecMul(basis[2],mat,e3);

	mat3FromDirAndUp(mat,basis[2],basis[1]);
	showmat3(mat);
}
