Jump to content

[Solved][1.10.2] Matrix multiplying doesn't affect model size


Recommended Posts

This is what my IBakedModel::handlePerspective() method looks like:


    public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
        switch (cameraTransformType) {
            case THIRD_PERSON_RIGHT_HAND:
                Matrix4f transform = new Matrix4f();
                float degree90 = (float)(Math.PI/2);
                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?

Link to comment
Share on other sites

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


Still the same size

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.