Posted July 26, 201312 yr I made a custom model for an item just as a test and I can't figure out what rotation would make this correct.(http://imagebin.org/265693) here's my render code: public class RenderHammer implements IItemRenderer { protected ModelHammer hammerModel; public RenderHammer() { hammerModel = new ModelHammer(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch(type) { case EQUIPPED: return true; case EQUIPPED_FIRST_PERSON: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type) { case EQUIPPED: case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.func_110577_a(new ResourceLocation("modclass","/textures/models/Hammer.png")); GL11.glRotatef(192F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(95F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F); float scale = 1.6F; GL11.glScalef(scale, scale, scale); this.hammerModel.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } default: } } }
July 28, 201312 yr Unfortunately no one can give you the answer. When it comes to model rotation you have to play with it until it is how you want it... I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes. I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there
July 28, 201312 yr Author it doesn't have to be a specific angle but how would a rotate it downwards, all the other ones just seem to turn it left or right
July 28, 201312 yr it doesn't have to be a specific angle but how would a rotate it downwards, all the other ones just seem to turn it left or right So you are wanting it to (say you are looking at the side) go from vertical, to 45˚? example: | to / I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes. I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there
July 28, 201312 yr Author well ya if you look at the picture i linked the handle is in my shoulder, how would i rotate it into my hand
July 28, 201312 yr As others have said, the best way to answer this kind of question is by experiment. Try changing each of the rotation angles a little bit, one axis at a time, and observe what happens. Once you've found the right axis, adjust the angle until you get the result you want. Keep in mind that when you perform multiple rotations, the effect of later ones will depend on the earlier ones. You may find it less confusing to start with all angles zero.
July 28, 201312 yr dude, i already told you in your other thread to just keep playing around with it. just keep trying, man. you're bound to get it right sooner or later.
July 28, 201312 yr Author But this is why I'm asking, i played around with them A LOT and none of them rotate on that axis but i'll keep trying I guess. sorry
July 28, 201312 yr hmm.. have you tried what gcewing suggested? starting with the angles at 0? im about to sleep, but i'll check back tomorrow. if you still haven't gotten it, i'll see what i can do. unless someone else helps you first
July 28, 201312 yr Author Well I guess I've solved it, I just had to use glTranslatef to put it into my hand and then rotate.
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.