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

I am using minecraft 1.20 and using a mixin in EntityRenderer renderLabelIfPresent.

I tried rendering the image like this:

```

 

float minX = h - (float) textRenderer.fontHeight - 2f; float maxX = h - 1f; float minY = i - 1f; float maxY = i + textRenderer.fontHeight; float minU = 0; float maxU = 128; float minV = 0; float maxV = 128;

 

VertexConsumer vertexConsumer2 = vertexConsumers.getBuffer(RenderLayer.getText(texture));
vertexConsumer2.vertex(matrix4f, minX, maxY, 0f).color(1f, 1f, 1f, 1f).texture(minU, minV).light(light).next();
vertexConsumer2.vertex(matrix4f, maxX, maxY, 0f).color(1f, 1f, 1f, 1f).texture(maxU, minV).light(light).next();
vertexConsumer2.vertex(matrix4f, maxX, minY, 0f).color(1f, 1f, 1f, 1f).texture(maxU, maxV).light(light).next();
vertexConsumer2.vertex(matrix4f, minX, minY, 0f).color(1f, 1f, 1f, 1f).texture(minU, maxV).light(light).next();

```
It kinda works. The problem is that the headpitch affects the zoom and every movement of the player shifts the image. This results in the image rendered multiple times in a grid and them constantly moving. I want that the image is rendered once at full size (minX, minY) -> (maxX, maxY)

 

The problem is that i get the position matrix like this: matrices.peek().getPositionMatrix();

I need the position of the player to render it. I created a duplicate matrix and replaced it with 0. There are 4 floats that are relevant for it to render.
new Matrix4f(matrix4f.m00(), 0, 0, 0, 0, matrix4f.m11(), 0, 0, 0, 0, 0, 0, 0, matrix4f.m31(), matrix4f.m32(), 0);
m31 controls the height where it is rendered. This does not fix anything. The question is how to i need to change m00, m11, m32 to render at the right pos and fix the weird effect

 

Edited by JustAUser

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.