- 117
- 7
Импортировал модель из MCAnimator'а и понял, что больше не буду им пользоваться. Очень много пришлось править, но в итоге от ошибок избавился. Зарегал нового моба, создал рендер, зашел в игру и увидел это. Моделька вверх ногами и даже так немного неправильно выглядит. Кидаю скрин и код модели. Может кто знает что это за хрень и как она вышла?


Java:
package ru.mark0wka.left4zombies.models;
import org.lwjgl.util.vector.Quaternion;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.entity.Entity;
public class ModelTank extends ModelBase
{
public ModelRenderer body;
public ModelRenderer rightlegtop;
public ModelRenderer leftlegtop;
public ModelRenderer leftleg;
public ModelRenderer rightleg;
public ModelRenderer bodymedium;
public ModelRenderer back;
public ModelRenderer backtop;
public ModelRenderer bodytop;
public ModelRenderer rightbreast;
public ModelRenderer leftbreast;
public ModelRenderer breastpeace;
public ModelRenderer rightcubictop;
public ModelRenderer rightcubic;
public ModelRenderer leftcubictop;
public ModelRenderer leftcubic;
public ModelRenderer head;
public ModelRenderer rightshoulder;
public ModelRenderer leftshoulder;
public ModelRenderer tongue;
public ModelRenderer rightarmtop;
public ModelRenderer leftarmtop;
public ModelRenderer rightarm;
public ModelRenderer leftarm;
public ModelTank()
{
textureWidth = 128;
textureHeight = 64;
this.body = new ModelRenderer(this, 0, 35);
this.body.addBox(-4.5F, 0.0F, 0.0F, 9, 5, 5);
this.body.setRotationPoint(0.0F, -8.0F, -1.0F);
//body.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.22495104F, 0.0F, 0.0F, 0.97437006F)).transpose());
this.body.setTextureSize(128, 64);
this.body.mirror = true;
setRotation(body, 0.22495104F, 0.0F, 0.0F);
this.rightlegtop = new ModelRenderer(this, 0, 7);
this.rightlegtop.addBox(-2.0F, -8.0F, 0.0F, 4, 8, 5);
this.rightlegtop.setRotationPoint(-2.5F, -8.0F, -1.0F);
//rightlegtop.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.18223552F, 0.0F, 0.0F, 0.9832549F)).transpose());
this.rightlegtop.setTextureSize(128, 64);
this.rightlegtop.mirror = true;
setRotation(rightlegtop, -0.18223552F, 0.0F, 0.0F);
this.leftlegtop = new ModelRenderer(this, 0, 21);
this.leftlegtop.addBox(-2.0F, -8.0F, 0.0F, 4, 8, 5);
this.leftlegtop.setRotationPoint(2.5F, -8.0F, -1.0F);
//leftlegtop.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.18223552F, 0.0F, 0.0F, 0.9832549F)).transpose());
this.leftlegtop.setTextureSize(128, 64);
this.leftlegtop.mirror = true;
setRotation(leftlegtop, -0.18223552F, 0.0F, 0.0F);
this.leftleg = new ModelRenderer(this, 58, 35);
this.leftleg.addBox(0.0F, -9.0F, -4.0F, 4, 9, 4);
this.leftleg.setRotationPoint(0.5F, -13.7F, 6.5F);
//leftleg.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.11320321F, 0.0F, 0.0F, 0.9935719F)).transpose());
this.leftleg.setTextureSize(128, 64);
this.leftleg.mirror = true;
setRotation(leftleg, 0.11320321F, 0.0F, 0.0F);
this.rightleg = new ModelRenderer(this, 41, 35);
this.rightleg.addBox(0.0F, -9.0F, -4.0F, 4, 9, 4);
this.rightleg.setRotationPoint(-4.5F, -13.7F, 6.5F);
//rightleg.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.11320321F, 0.0F, 0.0F, 0.9935719F)).transpose());
this.rightleg.setTextureSize(128, 64);
this.rightleg.mirror = true;
setRotation(rightleg, 0.11320321F, 0.0F, 0.0F);
this.bodymedium = new ModelRenderer(this, 74, 46);
this.bodymedium.addBox(-6.0F, 4.0F, -1.5F, 10, 12, 6);
this.bodymedium.setRotationPoint(1.0F, 0.5F, 1.0F);
//bodymedium.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.02617695F, 0.0F, 0.0F, 0.99965733F)).transpose());
this.bodymedium.setTextureSize(128, 64);
this.bodymedium.mirror = true;
setRotation(bodymedium, 0.02617695F, 0.0F, 0.0F);
this.body.addChild(bodymedium);
this.back = new ModelRenderer(this, 106, 52);
this.back.addBox(-4.0F, 0.0F, 0.0F, 8, 9, 3);
this.back.setRotationPoint(0.0F, 0.0F, 0.0F);
//back.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.1650476F, 0.0F, 0.0F, 0.9862856F)).transpose());
this.back.setTextureSize(128, 64);
this.back.mirror = true;
setRotation(back, -0.1650476F, 0.0F, 0.0F);
this.body.addChild(back);
this.backtop = new ModelRenderer(this, 102, 0);
this.backtop.addBox(0.0F, -13.0F, 0.0F, 9, 13, 4);
this.backtop.setRotationPoint(-4.5F, 20.7F, -5.1F);
//backtop.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.08715574F, 0.0F, 0.0F, 0.9961947F)).transpose());
this.backtop.setTextureSize(128, 64);
this.backtop.mirror = true;
setRotation(backtop, -0.08715574F, 0.0F, 0.0F);
this.body.addChild(backtop);
this.bodytop = new ModelRenderer(this, 0, 46);
this.bodytop.addBox(0.0F, 0.0F, -1.0F, 12, 10, 8);
this.bodytop.setRotationPoint(-6.0F, 13.0F, 1.5F);
//bodytop.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.3007058F, 0.0F, 0.0F, 0.95371693F)).transpose());
this.bodytop.setTextureSize(128, 64);
this.bodytop.mirror = true;
setRotation(bodytop, -0.3007058F, 0.0F, 0.0F);
this.body.addChild(bodytop);
this.rightbreast = new ModelRenderer(this, 48, 0);
this.rightbreast.addBox(0.0F, -5.0F, -5.0F, 5, 5, 5);
this.rightbreast.setRotationPoint(-5.5F, 17.0F, 7.5F);
//rightbreast.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.09584575F, 0.0F, 0.0F, 0.9953962F)).transpose());
this.rightbreast.setTextureSize(128, 64);
this.rightbreast.mirror = true;
setRotation(rightbreast, 0.09584575F, 0.0F, 0.0F);
this.body.addChild(rightbreast);
this.leftbreast = new ModelRenderer(this, 27, 0);
this.leftbreast.addBox(0.0F, -5.0F, -5.0F, 5, 5, 5);
this.leftbreast.setRotationPoint(0.5F, 17.0F, 7.5F);
//leftbreast.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.09584575F, 0.0F, 0.0F, 0.9953962F)).transpose());
this.leftbreast.setTextureSize(128, 64);
this.leftbreast.mirror = true;
setRotation(leftbreast, 0.09584575F, 0.0F, 0.0F);
this.body.addChild(leftbreast);
this.breastpeace = new ModelRenderer(this, 35, 35);
this.breastpeace.addBox(0.0F, -5.0F, -1.0F, 1, 5, 1);
this.breastpeace.setRotationPoint(-0.5F, 17.0F, 7.5F);
//breastpeace.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.1478094F, 0.0F, 0.0F, 0.9890159F)).transpose());
this.breastpeace.setTextureSize(128, 64);
this.breastpeace.mirror = true;
setRotation(breastpeace, 0.1478094F, 0.0F, 0.0F);
this.body.addChild(breastpeace);
this.rightcubictop = new ModelRenderer(this, 33, 0);
this.rightcubictop.addBox(-1.8F, 8.5F, 3.6999998F, 3, 2, 1);
this.rightcubictop.setRotationPoint(-1.0F, 0.5F, 1.0F);
//rightcubictop.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.026161004F, 0.0F, 0.034887537F, 0.9990484F)).transpose());
this.rightcubictop.setTextureSize(128, 64);
this.rightcubictop.mirror = true;
setRotation(rightcubictop, 0.026161004F, 0.0F, 0.034887537F);
this.body.addChild(rightcubictop);
this.rightcubic = new ModelRenderer(this, 56, 0);
this.rightcubic.addBox(-2.0F, 6.0F, 3.6999998F, 3, 2, 1);
this.rightcubic.setRotationPoint(-1.0F, 0.5F, 1.0F);
//rightcubic.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.026161004F, 9.1356237E-4F, 0.034887537F, 0.9990484F)).transpose());
this.rightcubic.setTextureSize(128, 64);
this.rightcubic.mirror = true;
setRotation(rightcubic, 0.026161004F, 0.0F, 0.034887537F );
this.body.addChild(rightcubic);
this.leftcubictop = new ModelRenderer(this, 34, 0);
this.leftcubictop.addBox(-1.2F, 8.5F, 3.6999998F, 3, 2, 1);
this.leftcubictop.setRotationPoint(1.0F, 0.5F, 1.0F);
//leftcubictop.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.026161004F, -9.1356237E-4F, -0.034887537F, 0.9990484F)).transpose());
this.leftcubictop.setTextureSize(128, 64);
this.leftcubictop.mirror = true;
setRotation(leftcubictop, 0.026161004F, 0.0F, -0.034887537F);
this.body.addChild(leftcubictop);
this.leftcubic = new ModelRenderer(this, 54, 0);
this.leftcubic.addBox(-1.0F, 6.0F, 3.6999998F, 3, 2, 1);
this.leftcubic.setRotationPoint(1.0F, 0.5F, 1.0F);
//leftcubic.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.026161004F, -9.1356237E-4F, -0.034887537F, 0.9990484F)).transpose());
this.leftcubic.setTextureSize(128, 64);
this.leftcubic.mirror = true;
setRotation(leftcubic, 0.026161004F, 0.0F, -0.034887537F);
this.body.addChild(leftcubic);
this.head = new ModelRenderer(this, 41, 49);
this.head.addBox(-4.0F, 1.0F, -5.0F, 8, 7, 8);
this.head.setRotationPoint(0.0F, 17.0F, 6.5F);
//head.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.22495104F, 0.0F, 0.0F, 0.97437006F)).transpose());
this.head.setTextureSize(128, 64);
this.head.mirror = true;
setRotation(head, -0.22495104F, 0.0F, 0.0F);
this.body.addChild(head);
this.rightshoulder = new ModelRenderer(this, 75, 0);
this.rightshoulder.addBox(-6.0F, -3.5F, -3.5F, 6, 7, 7);
this.rightshoulder.setRotationPoint(-6.0F, 19.5F, 1.5F);
//rightshoulder.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.22495104F, 0.0F, 0.0F, 0.97437006F)).transpose());
this.rightshoulder.setTextureSize(128, 64);
this.rightshoulder.mirror = true;
setRotation(rightshoulder, -0.22495104F, 0.0F, 0.0F);
this.body.addChild(rightshoulder);
this.leftshoulder = new ModelRenderer(this, 48, 0);
this.leftshoulder.addBox(0.0F, -3.5F, -3.5F, 6, 7, 7);
this.leftshoulder.setRotationPoint(6.0F, 19.5F, 1.5F);
//leftshoulder.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.22495104F, 0.0F, 0.0F, 0.97437006F)).transpose());
this.leftshoulder.setTextureSize(128, 64);
this.leftshoulder.mirror = true;
setRotation(leftshoulder, -0.22495104F, 0.0F, 0.0F);
this.body.addChild(leftshoulder);
this.tongue = new ModelRenderer(this, 20, 11);
this.tongue.addBox(-1.0F, -3.0F, -1.0F, 2, 3, 1);
this.tongue.setRotationPoint(0.0F, 2.0F, 1.0F);
//tongue.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(-0.45399052F, 0.0F, 0.0F, 0.8910065F)).transpose());
this.tongue.setTextureSize(128, 64);
this.tongue.mirror = true;
setRotation(tongue, -0.45399052F, 0.0F, 0.0F);
this.head.addChild(tongue);
this.rightarmtop = new ModelRenderer(this, 53, 16);
this.rightarmtop.addBox(-6.0F, -12.0F, -3.0F, 6, 12, 6);
this.rightarmtop.setRotationPoint(0.0F, -3.5F, 0.0F);
//rightarmtop.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, -0.043619387F, 0.99904823F)).transpose());
this.rightarmtop.setTextureSize(128, 64);
this.rightarmtop.mirror = true;
setRotation(rightarmtop, 0.0F, 0.0F, -0.043619387F);
this.rightshoulder.addChild(rightarmtop);
this.leftarmtop = new ModelRenderer(this, 27, 16);
this.leftarmtop.addBox(0.0F, -12.0F, -3.0F, 6, 12, 6);
this.leftarmtop.setRotationPoint(0.0F, -3.5F, 0.0F);
//leftarmtop.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.043619387F, 0.99904823F)).transpose());
this.leftarmtop.setTextureSize(128, 64);
this.leftarmtop.mirror = true;
setRotation(leftarmtop, 0.0F, 0.0F, 0.043619387F);
this.leftshoulder.addChild(leftarmtop);
this.rightarm = new ModelRenderer(this, 104, 21);
this.rightarm.addBox(-3.0F, -16.0F, 0.0F, 6, 16, 6);
this.rightarm.setRotationPoint(-3.0F, -11.0F, -3.0F);
//rightarm.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, 0.043619387F, 0.99904823F)).transpose());
this.rightarm.setTextureSize(128, 64);
this.rightarm.mirror = true;
setRotation(rightarm, 0.0F, 0.0F, 0.043619387F);
this.rightarmtop.addChild(rightarm);
this.leftarm = new ModelRenderer(this, 79, 21);
this.leftarm.addBox(-3.0F, -16.0F, 0.0F, 6, 16, 6);
this.leftarm.setRotationPoint(3.0F, -11.0F, -3.0F);
//leftarm.setInitialRotationMatrix(new Matrix4f().set(new Quaternion(0.0F, 0.0F, -0.043619387F, 0.99904823F)).transpose());
this.leftarm.setTextureSize(128, 64);
this.leftarm.mirror = true;
setRotation(leftarm, 0.0F, 0.0F, -0.043619387F);
this.leftarmtop.addChild(leftarm);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
body.render(f5);
rightlegtop.render(f5);
leftlegtop.render(f5);
leftleg.render(f5);
rightleg.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
}
}