Jump to content

[1.12.1] Rendering an Itemstack to a BufferBuilder


Busti

Recommended Posts

I am attempting to render an ItemStack in 3D, hovering over a block.

I would like to use a FastTESR to do so.

I am using 

renderItem.getItemModelWithOverrides(stack, null, null);

to get the item model.

 

Problem is I would like to apply translation, rotation and scaling to the rendered model.
Is there a handy method I can use without touching all the baked quads myself?

(Also if there is better practice to do this I would greatly appreciate any advice)

 

Pointing me to some reference code or an example implementation should be enough.

Edited by Busti

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

Would it even be a good Idea to do those transformations every frame?
Using a FastTESR they would probably have to be computed on the CPU and using the matrix stack would be more efficient?

Thoughts?

 

If not are there common methods to apply transformations to the entirety of an IBakedModel?

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Link to comment
Share on other sites

1 hour ago, Aeronica said:

I believe diesieben07 linked this code for a similar post about transforming baked quads.
https://github.com/Vazkii/Botania/blob/master/src/main/java/vazkii/botania/client/model/GunModel.java#L82-L106

 

Thanks that is exactly what I was looking for.
Yet the question remains if it is actually more efficient than using the matrix stack. Doing so many vertex operations on the cpu every frame does not feel correct.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

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.