0.1 Graph cube
This commit is contained in:
26
src/matrix.c
Normal file
26
src/matrix.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "main.h"
|
||||
#define inline
|
||||
#include <cglm/cglm.h>
|
||||
|
||||
void load_fix_matrix( unsigned int shader, float ratio )
|
||||
{
|
||||
mat4 m;
|
||||
|
||||
glm_lookat( (vec3){0,0,-5}, (vec3){0,0,0}, (vec3){0,1,0}, m );
|
||||
gload_mat4( shader, "cam", (float*)m );
|
||||
|
||||
glm_perspective( 45.0, ratio, 3, 7, m );
|
||||
gload_mat4( shader, "pry", (float*)m );
|
||||
}
|
||||
|
||||
void load_rot_matrix( unsigned int shader, char angle, unsigned char i )
|
||||
{
|
||||
mat4 m;
|
||||
char * name[] = {"rotx", "roty", "rotz"};
|
||||
vec3 axis = {0,0,0};
|
||||
|
||||
axis[(int)i]=1;
|
||||
|
||||
glm_rotate_make( m, (float)angle/0xff*GLM_PI, axis );
|
||||
gload_mat4( shader, name[(int)i], (float*)m );
|
||||
}
|
||||
Reference in New Issue
Block a user