Jump to content

Recommended Posts

Posted

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!

 

:)

Posted

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.

Posted

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.

Posted

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.

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.