Jump to content

Recommended Posts

Posted

I am trying to code a block which renders on its corner. The vertical axis goes through two corners on opisite sides of the cube. If possible I would like it to rotate. But If not don't worry about it. I have not had any success with trying to code this.

Posted

1.7.10 is no longer supported by forge, you are on your own.

Posted

After you have the TESR working, the rotation can be done like this (pseudocode):

 

 

int angle = 0;


public void renderTileEntityAt(TileEntity whatever, double xPos, double yPos, double zPos)
{
    angle++;
    if(angle > 359)
        angle = 0;
    GL11.glTranslated(xPos, yPos, zPos);
    GL11.glTranslated(0.5, 0.5, 0.5);
    //These glRotates are assuming you're drawing a cube in the normal Minecraft block orientation, then rotating it into position and animating it
    GL11.glRotated(angle, 0, 1, 0);
    GL11.glRotated(35, 1, 0, 0);
    GL11.glRotated(45, 0, 0, 1);
    GL11.glTranslated(-0.5, -0.5, -0.5);
    draw stuff/render model
    GL11.glTranslated(-xPos, -yPos, -zPos);
}

 

 

glRotate is a real nightmare, it's unfortunate that MC likely will never update to a newer OpenGL version.

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.