After applying a translation transformation, left_rotation and right_rotation still applies relative to the block model origin instead of the block_display entity origin.
In the two photos below the following transform has been applied:
{left_rotation:{angle:0f,axis:[0.57735f,0.57735f,-0.57735f]},right_rotation:{angle:0f,axis:[0f,0f,1f]},scale:[1f,1f,1f],translation:[-0.5f,-0.5f,-0.5f]}
with left_rotation's angle being updated in-between.
Attachments
Comments 6
@Dhranios , sorry my comment wasn't complete, I'm not saying the wiki documented the intent. What I'm trying to do is adding more information to this issue about how the transformation currently works. I mentioned the wiki only because there is some information about it on the wiki. The reason I say it is intentional is because I don't think there's a better way to decompose the matrix.
According to the 1.19.4 Release Notes, translation is applied first: "Transforms are composed in order translation, left_rotation, scale, right_rotation". https://www.minecraft.net/en-us/article/minecraft-java-edition-1-19-4
Is there a explanation for the intended behaviour? Is it the OpenGL pipeline? Or have I got my Quaternion transformations mixed up? As far as I understand affine transforms are normally applied around the new axis created by translations.
I think this is intended. Just as what https://minecraft.fandom.com/wiki/Display says, the conversion between the decomposed form and the matrix form is Mx=(TUΣV*)x, where M is the matrix form, x is a point vector, UΣV* are 4x4 matrices corresponding to the result of SVD of the upper-left 3x3 matrix, and T is the 4x4 translation matrix. So the translation is always applied last.