Posted June 5, 201510 yr I have rendered the armor piece, everything is in its place, the only problem i have with this is that i dont know how to bind the armor to the player movement like when you sneak your torso leans forward, but the armor stands still, also the arms of the torso are separate models, i know they wont just swing without me telling them to(even though i have not made those arm models yet, they will come after i have figured this out ). All i have managed to do is to change the rotation and position of the torso, by adding an if statement, but this wont work as well with the head, and it doesnt even toggle while sneaking, it just toggles while holding down shift. pls help if you can and here.. is the file i render the model onto the player with, in case you need it. and btw, i haven't rotated the model properly in the if statement, just played around with it a bit. @SideOnly(Side.CLIENT) public class renderBandosChestplate extends ModelBiped { private final ModelBandosChestplate modelBandosChestplate; public renderBandosChestplate() { super(); modelBandosChestplate = new ModelBandosChestplate(); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { GL11.glPushMatrix(); GL11.glScalef(0.5F, 0.45F, 0.5F); GL11.glRotatef(180.0F, 1.5F, 1.0F, -1.0F); GL11.glTranslatef(0.0F, -4.0F, 0.0F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(textures.model.BANDOS_CHESTPLATE); modelBandosChestplate.render(); GL11.glPopMatrix(); } else { GL11.glPushMatrix(); GL11.glScalef(0.5F, 0.45F, 0.5F); GL11.glRotatef(180.0F, 1.0F, 0.0F, -1.0F); GL11.glTranslatef(0.0F, -4.0F, 0.0F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(textures.model.BANDOS_CHESTPLATE); modelBandosChestplate.render(); GL11.glPopMatrix(); } } } thank you. i think it is something with the .addChild function, but i couldnt make it work
June 5, 201510 yr My computer doesn't like your avatar, it's fan is speeding up. But in fact I like it. I don't have any experience with this problem, all I know is that .addChild methods can be a pain. I have just mastered .obj models for blocks (and have made a tutorial for such) and might be able to help. So, you said the arms and the torso are a separate model? That might help you. Please post your code, I have an idea. It will probably involve GL11.
June 5, 201510 yr Author My computer doesn't like your avatar, it's fan is speeding up. But in fact I like it. thank you So, when you press shift in-game the armor doesn't rotate at all? no, it doesnt, unless i use that if statement, which really only solves the sneaking problem, not the arms.
June 5, 201510 yr Author I do know how to do it for techne models though, but when I tried doing that for my .obj file, i couldnt make it work, maybe i did something wrong
June 5, 201510 yr One idea is to add new child model to head model, which is going to be sub method class, which will render obj instead of model... Something like this: ObjModel model = ...; head.addChild(new Model(){ public void render(float f){ model.render(); } } ); Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
June 5, 201510 yr Ya, that could work, but I don't think the ObjModel class you're referring to exists. I think you mean ICustomModel.
June 5, 201510 yr Author the IModelCustom didnt work with .addChild(); but ModelRenderer did, but thats for techne i think? not sure though.
June 6, 201510 yr no, not yet Ok, so go to your class that extends ModelBiped, where you render your piece of armor. Go to constructor, and add: final IModelCustom objModel = AdvancedModelLoader.loadModel(objModelResource); ModelRenderer objModelAttach = new ModelRenderer(this){ @Override public void render(float f) { objModel.renderAll(); } }; //set offset here bipedHead.addChild(objModelAttach); This is code with correct names... This should work... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
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.