Fruitsalid Posted July 26, 2013 Posted July 26, 2013 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: } } } Quote
Fruitsalid Posted July 28, 2013 Author Posted July 28, 2013 Anyone know how to rotate it correctly? Quote
Mew Posted July 28, 2013 Posted July 28, 2013 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... Quote 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
Fruitsalid Posted July 28, 2013 Author Posted July 28, 2013 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 Quote
Mew Posted July 28, 2013 Posted July 28, 2013 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 / Quote 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
Fruitsalid Posted July 28, 2013 Author Posted July 28, 2013 well ya if you look at the picture i linked the handle is in my shoulder, how would i rotate it into my hand Quote
gcewing Posted July 28, 2013 Posted July 28, 2013 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. Quote
pelep Posted July 28, 2013 Posted July 28, 2013 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. Quote
Fruitsalid Posted July 28, 2013 Author Posted July 28, 2013 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 Quote
pelep Posted July 28, 2013 Posted July 28, 2013 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 Quote
Fruitsalid Posted July 28, 2013 Author Posted July 28, 2013 Well I guess I've solved it, I just had to use glTranslatef to put it into my hand and then rotate. Quote
Recommended Posts
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.