Skip to content

Commit 346f7ea

Browse files
add mat4f_invert & mat4f_determinant, update glfw ex
1 parent 07d1652 commit 346f7ea

File tree

5 files changed

+64
-551
lines changed

5 files changed

+64
-551
lines changed

examples/glfw/ex01.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ void render() {
7979
ct_mat4f_set_lookat(&view, &eye, &target, &up);
8080
ct_mat4f_set_perspective(&proj, 60, aspect, 0.1, 10);
8181

82-
ct_mat4f_mul(&view, &model, &t);
83-
mat4x4_invert((vec4*)&nmat, (vec4*)&t); // TODO
84-
ct_mat4f_transpose_imm(&nmat);
82+
ct_mat4f_transpose_imm(
83+
ct_mat4f_invert(ct_mat4f_mul(&view, &model, &t), &nmat));
8584

8685
glUseProgram(program);
8786
glUniformMatrix4fv(model_loc, 1, GL_FALSE, (GLfloat*)&model);

examples/glfw/glfw_example.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include "math/matrix.h"
1414
#include "math/vec.h"
1515

16-
#include "linmath.h"
17-
1816
#ifndef ASSET_PATH
1917
#ifdef __EMSCRIPTEN__
2018
#define ASSET_PATH "assets"

0 commit comments

Comments
 (0)