Some build fixes

This commit is contained in:
twinaphex 2017-04-22 10:09:52 +02:00
parent 40d55b7ae3
commit 45dc1b7977
2 changed files with 9 additions and 9 deletions

View File

@ -246,13 +246,13 @@ static void fft_render(glfft_t *fft, GLuint backbuffer, unsigned width, unsigned
center[1] = 0.0f;
center[2] = 1.0f;
vec3_add(&center[0], &eye[0]);
vec3_add(center, eye);
#ifdef GLM_USE_DEBUG
printf("center : %.2f, %.2f, %.2f\n", center[0], center[1], center[2]);
#endif
matrix_4x4_projection(&mvp_persp, (float)M_HALF_PI, (float)width / height, 1.0f, 500.0f);
matrix_4x4_projection(mvp_persp, (float)M_HALF_PI, (float)width / height, 1.0f, 500.0f);
#ifdef GLM_USE_DEBUG
printf("mvp_persp: \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n\n",
MAT_ELEM_4X4(mvp_persp, 0, 0),
@ -297,7 +297,7 @@ static void fft_render(glfft_t *fft, GLuint backbuffer, unsigned width, unsigned
MAT_ELEM_4X4(mvp_lookat, 3, 3)
);
#endif
matrix_4x4_multiply(mvp, &mvp_persp, &mvp_lookat);
matrix_4x4_multiply(mvp, mvp_persp, mvp_lookat);
#ifdef GLM_USE_DEBUG
printf("mvp: \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n %.2f, %.2f, %.2f, %.2f \n\n",
MAT_ELEM_4X4(mvp, 0, 0),

View File

@ -212,12 +212,12 @@ typedef struct math_matrix_4x4
vec3_t zaxis; /* the "forward" vector */ \
vec3_t xaxis; /* the "right" vector */ \
vec3_t yaxis; /* the "up" vector */ \
vec3_copy(&zaxis[0], center); \
vec3_subtract(&zaxis[0], eye); \
vec3_normalize(&zaxis[0]); \
vec3_cross(&xaxis[0], &zaxis[0], up); \
vec3_normalize(&xaxis[0]); \
vec3_cross(&yaxis[0], &xaxis[0], zaxis); \
vec3_copy(zaxis, center); \
vec3_subtract(zaxis, eye); \
vec3_normalize(zaxis); \
vec3_cross(xaxis, zaxis, up); \
vec3_normalize(xaxis); \
vec3_cross(yaxis, xaxis, zaxis); \
MAT_ELEM_4X4(out, 0, 0) = xaxis[0]; \
MAT_ELEM_4X4(out, 0, 1) = yaxis[0]; \
MAT_ELEM_4X4(out, 0, 2) = -zaxis[0]; \