-
-
Notifications
You must be signed in to change notification settings - Fork 262
Open
Description
It is common to multiply Model, View and Project matrices together, there may be additional matrices to multiply...
We have two option to multiply 3 matrices:
- Using
glm_mat4_mulN()
which is nice helper but it uses loop. - Using two
glm_mat4_mul()
call which is general.
Proposal:
New functions to multiply 3 or 4 matrices.
glm_mat4_mul3x(m1, m2, m3, dest)
,glm_mat4_mul4x(m1, m2, m3, m4, dest)
- general matrix multiplication to multiply 3 or 4 matricesglm_mvp(m, v, p)
orglm_pvm(p, v, m)
orglm_mul_mvp(m, v, p)
orglm_mul_pvm(p, v, m)
forModel * View * Proj
. Model matrix' rotation vectors' last component must be zero. (mvp vs pvm?)glm_trs
-Translate * Rotate * Scale
same for mat2 and mat3. Better names and ideas are always welcome. These functions will be optimized especially with SIMD, loop will not be used.
This will also make engines, renderers, games... faster and with less cglm call[s] and more readable, more neat... 🤗
recp, acoto87 and Lambdararecprecp and lczyk