The position property of a mesh is in local space, so any animation that targets it is already doing it in local space. To get the world position of a mesh you can use absolutePosition. TransformNode | Babylon.js Documentation (babylonjs.com). You don’t need to use matrices directly.
I would recommend to pass correctly clamped (relative to world) key values. If you really can’t, then another solution might be to customize/clamp your interpolation-functions:
The link of your second question should show how to do it.
1.
If you look at “playground”, I moved “position.x” to “animation” for “models.mes[3]”,
Move to the right, unlike “pivot” in “models.mes[3]”, as shown in the picture above.
If you moved to a “local” coordinate system like “pivot,” you should move down, But it moved to the right… I don’t like it.
I want to move using “animation” based on “pivot” of “mesh”.
ex) Slide = new BABYLON.Animation(“xSlide”, “mesh.pivot.position.x Features such as…”, frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ
Moved to “pivot Y Axis”.
However, in addition to “Absolute position X”, which is presumed to be “pivot Y Axis”, “Absolute position Y” among “Absolute position X,Y,Z”, also moved a little, so my discrimination was not accurate. Can I know about this?
It’s important to note that imported GLTFs have a __root__ node that converts between a right-handed system in GLTF and a left handed system in Babylon. To make reasoning easier, I would recommend baking the root node in the objects themselves, so the local axis align to expectations: Baking transforms imported GLTF | Babylon.js Playground (babylonjs.com)
It’s a good way, but in my situation, I can’t change “Axis” in “Mesh”.
I can’t “bake” “Mesh Axis” because I have to create an animation that goes to “Mesh Axis Z” for every “Mesh”…
Can’t you recognize “Mesh Axis Z” and put it in Animation…?
ex) new BABYLON.Animation(“xSlide”, “position.x <= Mesh pivot Z”, frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);