Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

  • Author

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

  • Author

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.

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.