TPD Posted August 12, 2016 Share Posted August 12, 2016 This is what my IBakedModel::handlePerspective() method looks like: @Override public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { switch (cameraTransformType) { case THIRD_PERSON_RIGHT_HAND: Matrix4f transform = new Matrix4f(); transform.setIdentity(); float degree90 = (float)(Math.PI/2); transform.mul(0.1F); transform.rotX(degree90); transform.rotZ(degree90); transform.rotY(degree90); return Pair.of(this, transform); } return Pair.of(this, null); } The model rotates correctly but its size doesn't change. What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
TPD Posted August 12, 2016 Author Share Posted August 12, 2016 That's what I was thinking aswell, but it doesn't seem to make a difference: Matrix4f scale = new Matrix4f( 0.1F, 0, 0, 0, 0, 0.1F, 0, 0, 0, 0, 0.1F, 0, 0, 0, 0, 1 ); transform.mul(scale); Still the same size Quote Link to comment Share on other sites More sharing options...
TPD Posted August 12, 2016 Author Share Posted August 12, 2016 Ok. I found the problem. The rot methods in Matrix4f set m00 and m33 (first element in first row, last element in last row) to 1. I had to first rotate it and then multiply it by 0.1 and finally set m33 back to 1. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.