Posted August 25, 201510 yr I'm trying to create a mod that has smaller models of regular vanilla mobs. Is there some way to resize a mob's model and texture? https://i.gyazo.com/9d22a3d74363977ac76d662e7c22effb.png[/img]
August 25, 201510 yr GL11 has a function called scale, you can just render the model you want to shrink and just call the scale function before the render method to make it bigger/smaller "you seem to be THE best modder I've seen imo." ~spynathan ლ(́◉◞౪◟◉‵ლ
August 25, 201510 yr You have to be a bit careful though, because the scale will scale around the origin of entity model which happens to be at 1.5 blocks above the ground. If you just scale it bigger then the bottom of your entity will go into the ground, and if you just scale it smaller then the bottom of your entity will not touch the ground. So you need to translate the model, then scale it. I've worked out the formula. You just need to push a transformation matrix then translate and scale (and don't forget to pop the matrix at the end). So like this: public void render(Entity parEntity, float par2, float par3, float par4, float par5, float par6, float par7) { setRotationAngles(parEntity, par2, par3, par4, par5, par6, par7, parEntity); // scale the whole thing for big or small entities GL11.glPushMatrix(); GL11.glTranslatef(0F, 1.5F-1.5F*parEntity.getScaleFactor(), 0F); GL11.glScalef(parEntity.getScaleFactor(), parEntity.getScaleFactor(), parEntity.getScaleFactor()); myModel.render(par7); // don't forget to pop the matrix for overall scaling GL11.glPopMatrix(); } You would substitute your scale factor and model of course for you your entity. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
August 25, 201510 yr Author I tried to add the code you specified, jabelar, to the render() method of ModelSpider.java, but I get the error "The method getScaleFactor() is unidentified for the Type Entity." Here is what I have for render(): public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_); // scale the whole thing for big or small entities GL11.glPushMatrix(); GL11.glTranslatef(0F, 1.5F-1.5F*p_78088_1_.getScaleFactor(), 0F); GL11.glScalef(p_78088_1_.getScaleFactor(), p_78088_1_.getScaleFactor(), p_78088_1_.getScaleFactor()); this.spiderHead.render(p_78088_7_); this.spiderNeck.render(p_78088_7_); this.spiderBody.render(p_78088_7_); this.spiderLeg1.render(p_78088_7_); this.spiderLeg2.render(p_78088_7_); this.spiderLeg3.render(p_78088_7_); this.spiderLeg4.render(p_78088_7_); this.spiderLeg5.render(p_78088_7_); this.spiderLeg6.render(p_78088_7_); this.spiderLeg7.render(p_78088_7_); this.spiderLeg8.render(p_78088_7_); // don't forget to pop the matrix for overall scaling GL11.glPopMatrix(); } https://i.gyazo.com/9d22a3d74363977ac76d662e7c22effb.png[/img]
August 25, 201510 yr You would substitute your scale factor and model of course for you your entity. Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
August 25, 201510 yr Author You would substitute your scale factor and model of course for you your entity. I'm sorry if I'm missing something obvious, but I'm still new to modding. Could you tell me what I'm doing wrong or what exactly it means to substitute the scale factor and model for my entity, if I didn't do that correctly? https://i.gyazo.com/9d22a3d74363977ac76d662e7c22effb.png[/img]
August 26, 201510 yr In Jabelar's example, he uses Entity#getScaleFactor() . In his own code, where he uses that, he probably casts the Entity parameter to his own Entity , which has the getScaleFactor() method. Now, you need to substitute the getScaleFactor() for your own way of getting the scale. You can either harcode it, or use a method in your own Entity . Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support. 1.12 -> 1.13 primer by williewillus. 1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support. http://www.howoldisminecraft1710.today/
August 26, 201510 yr Author I understand what you guys mean now. Thank you for the help! https://i.gyazo.com/9d22a3d74363977ac76d662e7c22effb.png[/img]
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.