I have a cube in GL in this plunkr that looks like this:
I would like to scale, rotate and translate the cube from a pivot. to hopefully make it animate like https://www.youtube.com/watch?v=sZeBm8EM3mw&feature=youtu.be
For this transformation I'll be using:
gl-matrix. luckily this transformation has a method for this under mat4.fromRotationTranslationScale()
Problem is I'm have a hell of a time just using the method? No errors, just the default implementation removed the cube from the screen.
mat4.fromRotationTranslationScale(
matrix,
quat.create(),
vec3.create(),
vec3.create()
);
(static)
fromRotationTranslationScale(out, q, v, s) → {mat4}
Creates a matrix from a quaternion rotation, vector translation and vector scale.
Parameters:
Name Type Description
out mat4 mat4 receiving operation result
q quat4 Rotation quaternion
v vec3 Translation vector
s vec3 Scaling vector
Question:
Am I using fromRotationTranslationScale
incorrectly? If so, where am I going wrong. if not, how can get some kind of feedback to play around with.
I'm weak with the math but I feel like I can reverse engineer and learn with your help ;).