Jump to content

Recommended Posts

Posted (edited)

I wrote this cord, but it is worked only when player hold items.

Moreover blocks render on player.

  @SubscribeEvent
  public static void onRenderPlayerPre(RenderPlayerEvent.Pre event) {
    GlStateManager.pushMatrix();
    GlStateManager.scalef(2.0f, 1.0f, 1.0f);
  }

  @SubscribeEvent
  public static void onRenderPlayerPost(RenderPlayerEvent.Post event) {
    GlStateManager.popMatrix();
  }

Then, how does GlStateManager.scalef work?

I want to change Player's scaleX(depth) to 1.2X and scaleZ(width) to 2.0Z.

GlStateManager.scalef(2.0f, 1.0f, 1.0f) makes a player fat, but depth doesn't change.

GlStateManager.scalef(1.0f, 1.0f, 2.0f) shrinks a player's height.

2020-01-24_16.00.28.png

Edited by kyazuki
  • Like 1
Posted
5 hours ago, kyazuki said:

I wrote this cord, but it is worked only when player hold items.

Moreover blocks render on player.


  @SubscribeEvent
  public static void onRenderPlayerPre(RenderPlayerEvent.Pre event) {
    GlStateManager.pushMatrix();
    GlStateManager.scalef(2.0f, 1.0f, 1.0f);
  }

  @SubscribeEvent
  public static void onRenderPlayerPost(RenderPlayerEvent.Post event) {
    GlStateManager.popMatrix();
  }

Then, how does GlStateManager.scalef work?

I want to change Player's scaleX(depth) to 1.2X and scaleZ(width) to 2.0Z.

GlStateManager.scalef(2.0f, 1.0f, 1.0f) makes a player fat, but depth doesn't change.

GlStateManager.scalef(1.0f, 1.0f, 2.0f) shrinks a player's height.

2020-01-24_16.00.28.png

It's 1.15.2, you should use scale methods using given in the event MatrixStack. If it is not given, you have to wait for Forge fix

Posted

I tried using scale method of MatrixStack.

@SubscribeEvent
  public static void onRenderPlayerPre(RenderPlayerEvent.Pre event) {
    event.getMatrixStack().push();
    event.getMatrixStack().scale(2.0f, 1.0f, 2.0f);
    //GlStateManager.pushMatrix();
    //GlStateManager.scalef(2.0f, 1.0f, 1.0f);
  }

  @SubscribeEvent
  public static void onRenderPlayerPost(RenderPlayerEvent.Post event) {
    event.getMatrixStack().pop();
    //GlStateManager.popMatrix();
  }

I want to make player fat from any direction.

But I look normal when seen from above.

2020-01-25_03.43.59.png

2020-01-25_03.44.05.png

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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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