Jump to content

Rotate TileEntityModel


redstonedude

Recommended Posts

Hi, I've made a block with a TileEntity and given the TileEntity a model so that i can get a block that's not got fixed 1x1x1 dimensions, however is there an easy way to rotate the model around the 4 directions (N,E,S,W) easily? Ive made the model in Techne but some of the boxes are at angles and some rotate so it would be possible to just use .setRotationAngle on the boxes but i woudl require some complex trigonomety to rotate and translate the boxes which in turn would take up lots of cpu and lag the game probably, is there a parameter in any other function like .render that i can use to rotate the model?

Link to comment
Share on other sites

GL11.GL_rotate(angle, amount_on_xaxis, amount_on_yaxis, amount_on_zaxis)

 

So probably, figure out how far to rotate it (metadata) and then GL11.GL_rotate(angle, 0, 1, 0)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

that goes in the renderer class i presume?

 

Yes.

 

And don't forget a push and pop matrix, if you don't already have one (you should).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

okay, will add that now, also thansk for the reminder about the matrix i was getting stack overflows cos i didn't pop it. also i know this is a bit off-topic but can you please explain pushing and popping matrixes to me quickly; i use pre-made rendering code and techne for all my modelling however i'm starting to understand how to manipulate it 'manually' quite well, my current understanding is pushing and popping matrixes is like creating and deleting variables, am I right?

Link to comment
Share on other sites

just noticed, GL_Rotate doesn't exist, i presume you mean glRotatef?

 

Ah yes.  I tend to remember things in vernacular and use the IDE code hinting features to get the name I'm trying to use.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

×
×
  • Create New...

Important Information

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