Posted July 27, 20214 yr Hello! I want to add tilted ears to some animals. Under ideal circumstances, I'd just modelPart.zRot = t. However, the rotation around the z axis is applied before the other rotations, which makes a big mess of everything. As far as I can tell, transformation of the matrix M represented by the PoseStack to the result R depending on the rotation matrices X, Y, Z and the translation matrix P is applied as such: R=XYZPM. My solution prior to 1.17 was to extend ModelRenderer and apply the transformations in the order ZXYPM - solving the problem very simply. But since ModelPart - the 1.17 counterpart to the old ModelRenderer - is final, I see no such simple solution. I see two possible approaches: Denote T=XYZP. Apply T^-1(ZXYP) to the PoseStack before I ModelPart#render. The ModelPart will then apply T, resulting in my desired ZXYP transformation. No problem in theory, but quite convoluted in practice. Consider Z(z)X(x)Y(y). Do some linear algebra and trigonometry to find out (s,t,u) such that X(s)Y(t)Z(u)=Z(z)X(x)Y(y), then ModelPart#setRotation(s,t,u). I haven't done the math on this, so I'm not sure how feasible this is. Anyone got a simpler solution? Or should I rather do a feature request to make ModelPart not final?
July 28, 20214 yr 7 hours ago, Anrza said: My solution prior to 1.17 was to extend ModelRenderer and apply the transformations in the order ZXYPM - solving the problem very simply. But since ModelPart - the 1.17 counterpart to the old ModelRenderer - is final you can use Access Transformer to remove the final modifier from the class Edited July 28, 20214 yr by Luis_ST
July 28, 20214 yr Author I must've struck gold if the recommendation is to use access transformers. Thanks.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.