Advertisement
Guest User

Untitled

a guest
Sep 6th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.91 KB | None | 0 0
  1. Java file:
  2.  
  3.  
  4. package com.animalcraft.animal;
  5.  
  6. import org.lwjgl.opengl.GL11;
  7.  
  8. import net.minecraft.client.model.ModelBase;
  9. import net.minecraft.client.model.ModelRenderer;
  10. import net.minecraft.entity.Entity;
  11. import net.minecraft.util.MathHelper;
  12.  
  13. /**
  14. * Red Panda - Roslyn
  15. * Created using Tabula 4.1.1
  16. */
  17. public class RedPanda extends ModelBase {
  18. public double[] modelScale = new double[] { 0.5D, 0.5D, 0.5D };
  19. public ModelRenderer ArmL;
  20. public ModelRenderer ArmR;
  21. public ModelRenderer LegLT;
  22. public ModelRenderer LegRT;
  23. public ModelRenderer Body;
  24. public ModelRenderer Tail1;
  25. public ModelRenderer Head;
  26. public ModelRenderer Neck;
  27. public ModelRenderer FrontPawL;
  28. public ModelRenderer FrontPawR;
  29. public ModelRenderer LegLB;
  30. public ModelRenderer BackPawL;
  31. public ModelRenderer LeftRB;
  32. public ModelRenderer BackPawR;
  33. public ModelRenderer Tail2;
  34. public ModelRenderer Tail3;
  35. public ModelRenderer Nose;
  36. public ModelRenderer EarR;
  37. public ModelRenderer EarL;
  38.  
  39. public RedPanda() {
  40. this.textureWidth = 75;
  41. this.textureHeight = 75;
  42. this.LegLB = new ModelRenderer(this, 25, 0);
  43. this.LegLB.setRotationPoint(0.0F, 1.8F, 0.0F);
  44. this.LegLB.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
  45. this.setRotateAngle(LegLB, 0.2792526803190927F, 0.0F, 0.0F);
  46. this.BackPawL = new ModelRenderer(this, 25, 5);
  47. this.BackPawL.setRotationPoint(0.0F, 0.7F, 0.5F);
  48. this.BackPawL.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
  49. this.setRotateAngle(BackPawL, -0.13962634015954636F, 0.0F, -0.006806784082777885F);
  50. this.Body = new ModelRenderer(this, 0, 6);
  51. this.Body.setRotationPoint(0.0F, 7.5F, -2.0F);
  52. this.Body.addBox(-2.0F, 0.0F, 0.0F, 4, 2, 5, 0.0F);
  53. this.FrontPawL = new ModelRenderer(this, 25, 5);
  54. this.FrontPawL.setRotationPoint(0.0F, 2.0F, 0.5F);
  55. this.FrontPawL.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
  56. this.FrontPawR = new ModelRenderer(this, 25, 5);
  57. this.FrontPawR.setRotationPoint(0.0F, 2.0F, 0.5F);
  58. this.FrontPawR.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
  59. this.Head = new ModelRenderer(this, 0, 13);
  60. this.Head.setRotationPoint(0.0F, 7.0F, 3.5F);
  61. this.Head.addBox(-1.5F, 0.0F, 0.0F, 3, 2, 2, 0.0F);
  62. this.setRotateAngle(Head, -0.17453292519943295F, 0.0F, 0.0F);
  63. this.LegRT = new ModelRenderer(this, 20, 0);
  64. this.LegRT.setRotationPoint(1.0F, 8.6F, -2.0F);
  65. this.LegRT.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
  66. this.setRotateAngle(LegRT, -0.13962634015954636F, 0.0F, 0.0F);
  67. this.ArmL = new ModelRenderer(this, 15, 0);
  68. this.ArmL.setRotationPoint(-2.0F, 9.0F, 2.0F);
  69. this.ArmL.addBox(0.0F, 0.0F, 0.0F, 1, 3, 1, 0.0F);
  70. this.Neck = new ModelRenderer(this, 23, 9);
  71. this.Neck.setRotationPoint(0.0F, 7.05F, 3.0F);
  72. this.Neck.addBox(-1.0F, 0.0F, 0.0F, 2, 2, 1, 0.0F);
  73. this.Tail1 = new ModelRenderer(this, 0, 0);
  74. this.Tail1.setRotationPoint(-0.5F, 7.6F, -2.0F);
  75. this.Tail1.addBox(0.0F, 0.0F, -2.0F, 1, 1, 2, 0.0F);
  76. this.setRotateAngle(Tail1, 0.22759093446006054F, 0.0F, 0.0F);
  77. this.LeftRB = new ModelRenderer(this, 25, 0);
  78. this.LeftRB.setRotationPoint(0.0F, 1.8F, 0.0F);
  79. this.LeftRB.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
  80. this.setRotateAngle(LeftRB, 0.2792526803190927F, 0.0F, -0.013264502315156905F);
  81. this.EarR = new ModelRenderer(this, 15, 5);
  82. this.EarR.setRotationPoint(1.0F, -0.5F, 0.0F);
  83. this.EarR.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
  84. this.ArmR = new ModelRenderer(this, 15, 0);
  85. this.ArmR.setRotationPoint(1.0F, 9.0F, 2.0F);
  86. this.ArmR.addBox(0.0F, 0.0F, 0.0F, 1, 3, 1, 0.0F);
  87. this.Nose = new ModelRenderer(this, 20, 5);
  88. this.Nose.setRotationPoint(-0.5F, 1.0F, 2.0F);
  89. this.Nose.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
  90. this.Tail2 = new ModelRenderer(this, 0, 0);
  91. this.Tail2.setRotationPoint(0.0F, 0.5F, -3.9F);
  92. this.Tail2.addBox(0.0F, 0.0F, 0.0F, 1, 1, 2, 0.0F);
  93. this.setRotateAngle(Tail2, 0.2617993877991494F, 0.0F, 0.0F);
  94. this.Tail3 = new ModelRenderer(this, 0, 0);
  95. this.Tail3.setRotationPoint(0.0F, 0.5F, -1.9F);
  96. this.Tail3.addBox(0.0F, 0.0F, 0.0F, 1, 1, 2, 0.0F);
  97. this.setRotateAngle(Tail3, 0.2617993877991494F, 0.0F, 0.0F);
  98. this.EarL = new ModelRenderer(this, 15, 5);
  99. this.EarL.setRotationPoint(-2.0F, -0.5F, 0.0F);
  100. this.EarL.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
  101. this.BackPawR = new ModelRenderer(this, 25, 5);
  102. this.BackPawR.setRotationPoint(0.0F, 0.7F, 0.5F);
  103. this.BackPawR.addBox(0.0F, 0.0F, 0.0F, 1, 1, 1, 0.0F);
  104. this.setRotateAngle(BackPawR, -0.13962634015954636F, 0.0F, 0.0F);
  105. this.LegLT = new ModelRenderer(this, 20, 0);
  106. this.LegLT.setRotationPoint(-2.0F, 8.6F, -2.0F);
  107. this.LegLT.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
  108. this.setRotateAngle(LegLT, -0.13962634015954636F, 0.0F, 0.0F);
  109. this.LegLT.addChild(this.LegLB);
  110. this.LegLB.addChild(this.BackPawL);
  111. this.ArmL.addChild(this.FrontPawL);
  112. this.ArmR.addChild(this.FrontPawR);
  113. this.LegRT.addChild(this.LeftRB);
  114. this.Head.addChild(this.EarR);
  115. this.Head.addChild(this.Nose);
  116. this.Tail1.addChild(this.Tail2);
  117. this.Tail2.addChild(this.Tail3);
  118. this.Head.addChild(this.EarL);
  119. this.LeftRB.addChild(this.BackPawR);
  120. }
  121.  
  122. @Override
  123. public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
  124. GL11.glPushMatrix();
  125. GL11.glScaled(1D / modelScale[0], 1D / modelScale[1], 1D / modelScale[2]);
  126. this.Body.render(f5);
  127. this.Head.render(f5);
  128. this.LegRT.render(f5);
  129. this.ArmL.render(f5);
  130. this.Neck.render(f5);
  131. this.Tail1.render(f5);
  132. this.ArmR.render(f5);
  133. this.LegLT.render(f5);
  134. GL11.glPopMatrix();
  135. }
  136.  
  137. /**
  138. * This is a helper function from Tabula to set the rotation of model parts
  139. */
  140. private void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
  141. modelRenderer.rotateAngleX = x;
  142. modelRenderer.rotateAngleY = y;
  143. modelRenderer.rotateAngleZ = z;
  144. }
  145.  
  146. public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
  147. {
  148. super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  149. float f6 = (180F / (float)Math.PI);
  150. this.LegLT.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;
  151. this.LegRT.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;
  152. this.LegLB.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1;
  153. this.LeftRB.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1;
  154. }
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement