I know only one way which is glm::mat4 matrix
I tried even float matrix[9][3]
which didn't work, I need it to multiply it with glm::vec3
How to create?
I know only one way which is glm::mat4 matrix
I tried even float matrix[9][3]
which didn't work, I need it to multiply it with glm::vec3
How to create?
You can compute that with 3x3 sub matrices and combine the outputs into final result. There are two options:
9 rows
a a a u'
a a a u'
a a a u'
b b b u v'
b b b * u = v'
b b b u v'
c c c w'
c c c w'
c c c w'
this is really simple:
u' = a*u
v' = b*u
w' = c*u
9 columns
u
u
u
a a a b b b c c c v u'
a a a b b b c c c * v = u'
a a a b b b c c c v u'
w
w
w
This is more complicated but not by much:
u.x' = (a*u).x + (b*v).x + (c*w).x
u.y' = (a*u).y + (b*v).y + (c*w).y
u.z' = (a*u).z + (b*v).z + (c*w).z
This is common way for expanding dimensionality in GLSL for example for purposes like these: