Jump to content

[1.7.10] Custom Modeled Block Queries


Recommended Posts

Well, it is just a simple matter of rotating the model itself instead of the block.


So for instance, if you're using an wavefront model you can just call


GL11.glrotatef(angle, xvector, yvector, zvector);


before you render your model.

Link to comment
Share on other sites

Well, what are you using then? The hardcoded way(tesselator)?


Let me add some stuff since it seems that isn't the only place you are stuck.


You can get the way the player is facing with


int l = MathHelper.floor_double((double)(Player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;


int the onBlockPlacedBy method.


Then write that value to metadata.


In your renderclass just read the metadata again and rotate the object accordingly(e.g. 2 == 0°, 3 == 90°, 4 == 180° & 5 == 270° or something like that)

and between your GL11.glpushMatrix() and gl11.glPopMatrix you just place


GL11.rotatef(yourpreviouslycalculatedangle, 0.0, 1.0f, 0.0f);


and this should actually work with whatever type of model you use.

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.

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.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.