I don't really feel like this needs much of an explanation...
Model as it appears in Techne (sorry, dropbox images broke, have to post links):
https://www.dropbox.com/s/xcpuvz0stihu4s2/meh.PNG
Model as it appears in-game:
https://www.dropbox.com/s/rxk5klq65lvtvtd/javaw%202014-06-13%2000-35-48-151.png
And my code:
Model
public class ModelGoblinModel extends ModelBase
{
//fields
ModelRenderer Head;
ModelRenderer RightEar;
ModelRenderer LeftEar;
ModelRenderer Nose;
ModelRenderer NosePart2;
ModelRenderer UpperArm2;
ModelRenderer UpperArm1;
ModelRenderer LowerArm2;
ModelRenderer LowerArm1;
ModelRenderer UpperBody;
ModelRenderer LowerBody;
ModelRenderer Leg2;
ModelRenderer Leg1;
ModelRenderer Foot2;
ModelRenderer Foot1;
ModelRenderer UpperLeg1;
ModelRenderer UpperLeg2;
ModelRenderer hilt;
ModelRenderer CrossGuard;
ModelRenderer CrossGuardLeft;
ModelRenderer CrossGuardRight;
ModelRenderer Blade;
ModelRenderer BladePart3;
ModelRenderer BladePart2;
public ModelGoblinModel()
{
textureWidth = 64;
textureHeight = 32;
Head = new ModelRenderer(this, 42, 0);
Head.addBox(-3F, -5F, -2.5F, 6, 5, 5);
Head.setRotationPoint(0F, 5F, 0F);
Head.setTextureSize(64, 32);
setRotation(Head, 0F, 0F, 0F);
Nose = new ModelRenderer(this, 50, 26);
Nose.addBox(-0.5F, -0.5F, -1F, 1, 1, 1);
Nose.setRotationPoint(0F, 3F, -2F);
Nose.setTextureSize(64, 32);
setRotation(Nose, 0.1745329F, 0F, 0F);
Head.addChild(Nose);
NosePart2 = new ModelRenderer(this, 50, 29);
NosePart2.addBox(-0.5F, -0.5F, -1F, 1, 2, 1);
NosePart2.setRotationPoint(0F, 3.7F, -2.5F);
NosePart2.setTextureSize(64, 32);
setRotation(NosePart2, -0.5948578F, 0F, 0F);
Nose.addChild(NosePart2);
RightEar = new ModelRenderer(this, 54, 29);
RightEar.addBox(-4F, -1F, -0.5F, 4, 2, 1);
RightEar.setRotationPoint(-2.5F, 2F, 0F);
RightEar.setTextureSize(64, 32);
setRotation(RightEar, 0.3490659F, 0.7853982F, 0.3490659F);
Head.addChild(RightEar);
LeftEar = new ModelRenderer(this, 54, 26);
LeftEar.addBox(0F, -1F, -0.5F, 4, 2, 1);
LeftEar.setRotationPoint(2.5F, 2F, 0F);
LeftEar.setTextureSize(64, 32);
setRotation(LeftEar, 0.3490659F, -0.7853982F, -0.3490659F);
Head.addChild(LeftEar);
UpperArm2 = new ModelRenderer(this, 28, 24);
UpperArm2.addBox(-1F, 0F, -1.5F, 2, 5, 3);
UpperArm2.setRotationPoint(3F, 5F, 0.5F);
UpperArm2.setTextureSize(64, 32);
setRotation(UpperArm2, 0.4014257F, 0.1483529F, -0.3665191F);
UpperArm1 = new ModelRenderer(this, 38, 24);
UpperArm1.addBox(-1F, 0F, -1.5F, 2, 5, 3);
UpperArm1.setRotationPoint(-3F, 5F, 0.5F);
UpperArm1.setTextureSize(64, 32);
setRotation(UpperArm1, 0.4014257F, -0.1483529F, 03665191F);
LowerArm2 = new ModelRenderer(this, 26, 6);
LowerArm2.addBox(-1F, 0F, -1F, 2, 6, 2);
LowerArm2.setRotationPoint(3F, 10F, 0.5F);
LowerArm2.setTextureSize(64, 32);
setRotation(LowerArm2, -0.7853981F, 0F, 0F);
UpperArm2.addChild(LowerArm2);
LowerArm1 = new ModelRenderer(this, 34, 6);
LowerArm1.addBox(-1F, 0F, -1F, 2, 6, 2);
LowerArm1.setRotationPoint(-3F, 10F, 0.5F);
LowerArm1.setTextureSize(64, 32);
setRotation(LowerArm1, -0.7853981F, 0F, 0F);
UpperArm1.addChild(LowerArm1);
UpperLeg1 = new ModelRenderer(this, 26, 0);
UpperLeg1.addBox(-1F, 0F, -1F, 2, 4, 2);
UpperLeg1.setRotationPoint(-2F, 15F, 0.5F);
UpperLeg1.setTextureSize(64, 32);
setRotation(UpperLeg1, -0.5235988F, 0F, 0F);
Leg1 = new ModelRenderer(this, 30, 14);
Leg1.addBox(-1F, 0F, -1F, 2, 6, 2);
Leg1.setRotationPoint(-2F, 18F, -1.5F);
Leg1.setTextureSize(64, 32);
setRotation(Leg1, 0.4014257F, 0F, 0F);
UpperLeg1.addChild(Leg1);
Foot1 = new ModelRenderer(this, 20, 29);
Foot1.addBox(-1F, 0F, -1F, 2, 1, 2);
Foot1.setRotationPoint(-2F, 23F, -0.5F);
Foot1.setTextureSize(64, 32);
setRotation(Foot1, 0F, 0F, 0F);
UpperLeg2 = new ModelRenderer(this, 34, 0);
UpperLeg2.addBox(-1F, 0F, -1F, 2, 4, 2);
UpperLeg2.setRotationPoint(2F, 15F, 0.5F);
UpperLeg2.setTextureSize(64, 32);
setRotation(UpperLeg2, -0.5235988F, 0F, 0F);
Leg2 = new ModelRenderer(this, 38, 14);
Leg2.addBox(-1F, 0F, -1F, 2, 6, 2);
Leg2.setRotationPoint(2F, 18F, -1.5F);
Leg2.setTextureSize(64, 32);
setRotation(Leg2, 0.4014257F, 0F, 0F);
UpperLeg2.addChild(Leg2);
Foot2 = new ModelRenderer(this, 20, 26);
Foot2.addBox(-1F, 0F, -1F, 2, 1, 2);
Foot2.setRotationPoint(2F, 23F, -0.5F);
Foot2.setTextureSize(64, 32);
setRotation(Foot2, 0F, 0F, 0F);
Leg2.addChild(Foot2);
UpperBody = new ModelRenderer(this, 46, 10);
UpperBody.addBox(-3F, -5F, -1F, 6, 5, 3);
UpperBody.setRotationPoint(0F, 10F, 0F);
UpperBody.setTextureSize(64, 32);
setRotation(UpperBody, 0F, 0F, 0F);
LowerBody = new ModelRenderer(this, 48, 18);
LowerBody.addBox(-2.5F, -2F, -1F, 5, 5, 3);
LowerBody.setRotationPoint(0F, 12F, 0F);
LowerBody.setTextureSize(64, 32);
setRotation(LowerBody, 0F, 0F, 0F);
hilt = new ModelRenderer(this, 0, 28);
hilt.addBox(0F, 0F, 0F, 1, 1, 3);
hilt.setRotationPoint(-4F, 14F, -1F);
hilt.setTextureSize(64, 32);
setRotation(hilt, 0F, 0F, 0F);
LowerArm1.addChild(hilt);
CrossGuard = new ModelRenderer(this, 0, 0);
CrossGuard.addBox(0F, 0F, 0F, 1, 3, 1);
CrossGuard.setRotationPoint(-4F, 13F, -2F);
CrossGuard.setTextureSize(64, 32);
setRotation(CrossGuard, 0F, 0F, 0F);
hilt.addChild(CrossGuard);
CrossGuardLeft = new ModelRenderer(this, 8, 26);
CrossGuardLeft.addBox(0F, 0F, 0F, 1, 2, 1);
CrossGuardLeft.setRotationPoint(-4F, 15.4F, -1.7F);
CrossGuardLeft.setTextureSize(64, 32);
setRotation(CrossGuardLeft, -0.5948578F, 0F, 0F);
CrossGuard.addChild(CrossGuardLeft);
Blade = new ModelRenderer(this, 0, 11);
Blade.addBox(0F, 0F, 0F, 1, 3, 12);
Blade.setRotationPoint(-4F, 13F, -14F);
Blade.setTextureSize(64, 32);
setRotation(Blade, 0F, 0F, 0F);
CrossGuard.addChild(Blade);
CrossGuardRight = new ModelRenderer(this, 8, 29);
CrossGuardRight.addBox(0F, 0F, 0F, 1, 2, 1);
CrossGuardRight.setRotationPoint(-4F, 13.1F, -0.9F);
CrossGuardRight.setTextureSize(64, 32);
setRotation(CrossGuardRight, 3.735005F, 0F, 0F);
CrossGuard.addChild(CrossGuardRight);
BladePart3 = new ModelRenderer(this, 15, 4);
BladePart3.addBox(0F, 0F, 0F, 1, 1, 1);
BladePart3.setRotationPoint(-4F, 12F, -13F);
BladePart3.setTextureSize(64, 32);
setRotation(BladePart3, 0F, 0F, 0F);
Blade.addChild(BladePart3);
BladePart2 = new ModelRenderer(this, 4, 0);
BladePart2.addBox(0F, 0F, 0F, 1, 2, 1);
BladePart2.setRotationPoint(-4F, 11F, -14F);
BladePart2.setTextureSize(64, 32);
setRotation(BladePart2, 0F, 0F, 0F);
Blade.addChild(BladePart2);
}
@Override
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);
Head.render(f5);
Nose.render(f5);
UpperArm2.render(f5);
UpperArm1.render(f5);
LowerArm2.render(f5);
LowerArm1.render(f5);
Leg2.render(f5);
Leg1.render(f5);
LowerBody.render(f5);
Foot2.render(f5);
UpperLeg1.render(f5);
UpperLeg2.render(f5);
UpperBody.render(f5);
hilt.render(f5);
CrossGuard.render(f5);
CrossGuardLeft.render(f5);
RightEar.render(f5);
LeftEar.render(f5);
Blade.render(f5);
CrossGuardRight.render(f5);
NosePart2.render(f5);
Foot1.render(f5);
BladePart3.render(f5);
BladePart2.render(f5);
}
protected void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
this.Head.rotateAngleY = f3 / (180F / (float)Math.PI);
this.Head.rotateAngleX = f3 / (180F / (float)Math.PI);
this.UpperArm1.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 2.0F * f1 * 0.5F;
this.UpperArm2.rotateAngleX = MathHelper.cos(f * 0.6662F) * 2.0F * f1 * 0.5F;
this.UpperArm1.rotateAngleZ = 0.0F;
this.UpperArm2.rotateAngleZ = 0.0F;
this.UpperLeg1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;
this.UpperLeg2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;
this.UpperLeg1.rotateAngleY = 0.0F;
this.UpperLeg2.rotateAngleY = 0.0F;
float f6;
float f7;
}
}
Renderer:
public class GoblinRenderer extends RenderLiving {
private static final ResourceLocation texLoc = new ResourceLocation(Reference.MODID + ":" + "textures/models/goblin.png");
public GoblinRenderer(ModelGoblinModel model, float shadowSize)
{
super(model, shadowSize);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity)
{
return texLoc;
}
}