Jump to content

[Solved] [1.12.2] Translating Baked Quads


Spyeedy

Recommended Posts

Thought I should make a new thread instead of continuing my other thread, seeing as I've successfully managed to attach other models onto the same model.

 

So I'm adding a Baked Model's quads to my main item's Baked Model, and that renders successfully. The problem I'm stuck at is, how do I move a BakedQuad, so basically changing it's position?

 

Here's my Baked Model code where I'm adding other Baked Models to my main item's Baked Model

https://gist.github.com/Spyeedy/2cdf9d335eb57dbe54bca1a9198650f8

Edited by Spyeedy

width=620 height=260http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img]

Till next time. Thank you for delivering funny scenes to Star Trek as Chekov :) . Will always remember you

Link to comment
Share on other sites

  • 2 weeks later...

I managed to solve it after a week or so of racking my brain for a solution.

 

I had a thought, why not modify the vertex data of the BakedQuad itself and change the numbers myself. I didn't know how to modify the vertex data, so I did some googling and it pointed me to this thread.

Which in turn lead me to this chunk of code here.

That's where I got stuck (yes, my mind was too fixated on that chunk of code to actually post an update here).

 

So I printed the float array provided by IVertexConsumer#put and I was scratching my head over the set of floats it was giving me, then today, it hit me, those were coordinates, specifically translation coordinates for Minecraft to draw a quad.

 

That's when I did some math (multiplication by 16) with the coordinates to determine which coordinate affect the 3 axes of a model, X Y Z.

 

And then, I came to my solution here. I just took the data

Edited by Spyeedy

width=620 height=260http://www.startrek.com/uploads/assets/articles/61c89a9d73c284bda486afaeaf01cdb27180359b.jpg[/img]

Till next time. Thank you for delivering funny scenes to Star Trek as Chekov :) . Will always remember you

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.