I’m trying to figure out the axes of objects. The problem is that when the object rotates, the axis remains in the same position. And I can not move one of the axes, for example, in a blender when switching to local axes, the object moves along its own axes, and not the world axes.
Example we have an object - a cube:
I moved it along the x-axis to 1.
cube.setLocalTranslation(new Vector3f(1, 0, 0));
All perfectly. Now I pre-rotate it to 45 degrees.
float[] angles = {0, 0.785398f, 0};
cube.getLocalRotation().fromAngles(angles);
And I move it again along the x axis.
cube.setLocalTranslation(new Vector3f(1, 0, 0));
But something went wrong, because I’m moving in its axis x, and not the world. However, logically, it should look like this:
The actual issue is that, obviously, jME does not rotate the object matrix. How can I force it. So he moved along the logic in the last image?
And another question why get, not set.
cube.getLocalRotation().fromAngles(angles);