Jump to content

[1.9] Render item in block model


DARKHAWX

Recommended Posts

So I want to achieve something similar to the way the Arcane Pedestals from Thaumcraft work, wherein they render the item they are holding above them, but I have no idea how to go about that. I currently have a tile entity that will store and item upon clicking it, so how would I get it so that it displays the items it has above it?

No signature for you!

Link to comment
Share on other sites

I had some issues getting it to work initially too. But I realized that the item was rendering, but it was rendering outside of my view. I messed up the translations. I looked at the code for the Project E and that was similar, but not updated to 1.9.

 

After some head scratching and testing I got it to work. The end result for me is a piano with and Item that can be placed on the music rack.

p9xUl.png

Link to comment
Share on other sites

Okay, one last thing. With the way my tile entity works, it can store up to 8 items, and will display them all. To do this I created a for loop (the items are stored in a list) and then would render each item, translating and scaling each time. However, the translate and scale functions are relative, which makes it a little harder to display this sort of stuff, is there a way I can 'reset' the position and scale of the render? i.e. is there some function like GlStateManager.position(x,y,z) or do I have to make my translations/scale changes and then manually revert them afterwards?

 

No signature for you!

Link to comment
Share on other sites

Pushing and popping the GL state comes to mind. I do that because I have three models that I need to apply different translation and rotations to. The music rack, bench and the inventory item to be displayed. I'm using TESR for now, but I'd like to convert over to the new animation system. My goal is to have the music rack flip up and down and the bench move in and out. The piano itself is  based on the vanilla bed code. So one block, two models. The the rack and bench are just normal json defined models rendered in the TESR.

Link to comment
Share on other sites

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.