Hello,
I am trying to rotate the element with the following transformation.
var angle = angulo;
var trans = {
id: "transformation",
matrix: glMatrix.mat4.mul(
glMatrix.mat4.create(),
glMatrix.mat4.fromTranslation(glMatrix.mat4.create(), glMatrix.vec3.fromValues(planner.sceneTree.root.children[idMove].transformations[0].matrix[12], planner.sceneTree.root.children[idMove].transformations[0].matrix[13] , planner.sceneTree.root.children[idMove].transformations[0].matrix[14])),
glMatrix.mat4.mul(
glMatrix.mat4.create(),
glMatrix.mat4.fromScaling(glMatrix.mat4.create(), glMatrix.vec3.fromValues(1,1,1)),
glMatrix.mat4.fromRotation(glMatrix.mat4.create(), angle, glMatrix.vec3.fromValues(0,0,1)),
)
),
};
planner.sceneTree.root.children[idMove].transformations = [];
planner.sceneTree.root.children[idMove].transformations.push(trans);
await planner.viewer.updateNodeTransformation(planner.sceneTree.root.children[idMove]);
But it rotates around 0,0,0 and I would like it to be in the center of the model. Thank you so much