Posted May 12, 201510 yr 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.
May 12, 201510 yr MC version is important here Lots of stuff is documented here: http://greyminecraftcoder.blogspot.co.at/p/list-of-topics.html http://www.minecraftforge.net/forum/index.php/topic,26267.0.html EDIT More direct info here: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe21_tileentityspecialrenderer TESR is your friend. 1.7.10 is no longer supported by forge, you are on your own.
May 13, 201510 yr 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.
May 13, 201510 yr Author Is there a good text tutorial for how to code a 1.7.10 custom rendered block
May 14, 201510 yr Author that isnt a text tutorial (duh) but it was very helpful, the first video was him making a table in techne.....
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.