Posted April 23, 201411 yr After many hours of frustrating labor, I have finally figured out, thanks to the assistance of the lovely MMM_MasterM, how to rotate a block's top-facing textures based on placement metadata. Here was my dilemma: I created a Conveyor Belt that used the metadata integers 0-3 to determine placement. I also used the renderBlockLog in RenderBlocks as guidance for how I would rotate the texture. I learned that, using uvRotateTop, I could change the texture's rotation. The problem I was having was that the in-game directions North and East were placing fine, but the South and West ones weren't. By setting the uvRotateTop to 1, you could rotate the texture East. I thought that if I just set the uvRotateTop to 2, I could get it to rotate South. I was wrong. Solution: Well, it was really a matter of recognizing that the uv-related stuff in Minecraft is somewhat...unhelpful. It took a lot of back and forth banter between me and MMM_MasterM to fix the issue. Anyway, below I have posted the code from my SBRH so that none of you may ever have to experience what I just did. Let this be a learning experience! http://pastebin.com/csy3Ahnh This shows an example of one of the methods from the SBRH. I am going to move it to the renderInvBlock, and then you can just set the renderWorldBlock to true. In any case, I hope this helps!
April 23, 201411 yr Hi This might be of interest to you as well. http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html I spent a few very frustrating hours last year figuring it out too... what were Notch & co thinking-?! -TGG
April 23, 201411 yr Why don't you just use GL11.glRotate(angle, 0F, 1F, 0F); ? If i helped you, don't forget pressing "Thank You" button. Thanks for your time.
April 23, 201411 yr Because you can't do that in an ISBRH, it would rotate the entire chunk. So, GL11.glPushMatrix(); & GL11.glPopMatrix(); are not working from now? If i helped you, don't forget pressing "Thank You" button. Thanks for your time.
April 23, 201411 yr Author Yeah, using OpenGL in that case did not help. You had to have used the Tessellator. I mean, MC has the methods necessary to rotate textures nicely, but they're a bit convoluted and backwards. Maybe an API or Forge addition could be developed to make this a tiny bit easier—I'd do it myself, but I don't think I possess the know-how for something like that considering it took me an hour to figure out what was wrong. Other than that, I really love the SBRHs.
April 23, 201411 yr Author Hi This might be of interest to you as well. http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html I spent a few very frustrating hours last year figuring it out too... what were Notch & co thinking-?! -TGG Thanks for that! You know, I had looked at that before, but I guess I shoulda bookmarked it when I did because I forgot where to find it. Anyway, I guess it helped me in a way since it was a learning experience (just not a fun one).
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.