Анимация рендера

Сообщения
51
Лучшие ответы
0
Реакции
0
Версия Minecraft
1.7.10
Всем привет!
Не знаю как задавать движение модели предмета при условии. Сам условие есть, но нету движения.
Вот код:
Код:
package ua.dark.base.renders;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import ua.dark.base.Main;

public class RenderRifel implements IItemRenderer {
 //Пока все работает.
 
 public static final ResourceLocation rifel = new ResourceLocation(Main.MODID, "model/items/Rifle.obj");
 public static final ResourceLocation rifel_1_face = new ResourceLocation(Main.MODID, "model/items/rifel_1_face.obj");
 public static final ResourceLocation hands = new ResourceLocation(Main.MODID, "model/items/hands.obj");
 public static final ResourceLocation swordTex = new ResourceLocation(Main.MODID);
    
   
   public IModelCustom rifel_model = AdvancedModelLoader.loadModel(rifel);
   public IModelCustom rifel_model_1 = AdvancedModelLoader.loadModel(rifel_1_face);
   public IModelCustom hands_model = AdvancedModelLoader.loadModel(hands);
   
   
   @Override
   public boolean handleRenderType(ItemStack item, ItemRenderType type) {
   
      switch(type) {
      case EQUIPPED: {
      GL11.glPushMatrix();
      GL11.glPopMatrix();
      
         return true;
      } 
      case EQUIPPED_FIRST_PERSON: {
      GL11.glPushMatrix();
      /*Minecraft.getMinecraft().renderEngine.bindTexture(swordTex);
   rifel_model_1.renderAll();
   Minecraft.getMinecraft().renderEngine.bindTexture(Minecraft.getMinecraft().thePlayer.getLocationSkin());
   hands_model.renderAll(); */
   GL11.glPopMatrix();
   //povorot
   
 /*if(Minecraft.getMinecraft().thePlayer.isSprinting())
 {
 GL11.glRotatef(180, 10, 50, 70);
 }
 else
 {
 
 }*/
   
   }
         return true;
         
      
      
      case ENTITY: {
      GL11.glPushMatrix();
      GL11.glPopMatrix(); 
   
      return true;
      }
      
      default: return false;
      }
      
      
      
  }
      
      
 
 @Override
 public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
 
 
 return false;
 }

 @Override
 public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
 GL11.glPushMatrix();
 GL11.glPopMatrix(); 
 //float scale = 1.0F;
 //GL11.glScalef(scale, scale, scale);
 // надо все сюда от 1лица, ты смогешь!
 //mb
     switch(type) {
      
     case ENTITY:
     GL11.glPushMatrix(); 
     Minecraft.getMinecraft().renderEngine.bindTexture(swordTex);
     rifel_model.renderAll();
         GL11.glPopMatrix();   
         break;
     case EQUIPPED:
       
     GL11.glPushMatrix();
     Minecraft.getMinecraft().renderEngine.bindTexture(swordTex);
     rifel_model.renderAll();
     GL11.glPopMatrix();   
           
           
         break;
     case EQUIPPED_FIRST_PERSON:
     GL11.glPushMatrix();
     Minecraft.getMinecraft().renderEngine.bindTexture(swordTex);
   rifel_model_1.renderAll();
   Minecraft.getMinecraft().renderEngine.bindTexture(Minecraft.getMinecraft().thePlayer.getLocationSkin());
   hands_model.renderAll();
   GL11.glPopMatrix();
   //run
   if(Minecraft.getMinecraft().thePlayer.isSprinting()){
 
                GL11.glRotatef(47F, -1F, -2F, 1.3F);
                GL11.glRotatef(65F, -10F, 1.1F, 0F);
                GL11.glRotatef(100F, 0F, 0F, 1F);
                GL11.glTranslatef(0.8F, -0.1F, 0.35F);
                GL11.glScalef(0.05F, 0.05F, 0.05F);
            }
            else
            {
                GL11.glRotatef(47F, -1F, -2F, 1.3F);
                GL11.glRotatef(65F, -10F, 1.1F, 0F);
                GL11.glRotatef(18F, 0F, 0F, 1F);
                GL11.glTranslatef(0.5F, 0.6F, 0.35F);
                GL11.glScalef(0.08F, 0.08F, 0.08F);
            }
         break;         
     case INVENTORY:
        
     
         break;
     case FIRST_PERSON_MAP:
         
     
     
     
         break;
     default:
         break;
     }
     } 
 
 }
    
Объясните в чем проблема?
 
Сообщения
624
Лучшие ответы
4
Реакции
8
Мдаа, ну и ужас код.
Вот смотри, все действия с моделью(будто это поворот\положение\размер) ты должен делать в матрице, где рендерится сама модель.
Допустим:
Код:
GL11.glPushMatrix();
//транслейты всякие и тп
//условие
model.renderAll():
Gl11.glPopMatrix();
А вообще держи рендер с ZProject'a(все равно закрылся)
Код:
package ZProject.ZEngine.Weapons.Renderers;

import java.util.Random;

import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;

import ZProject.ZProject;
import ZProject.ZEngine.Weapons.Models.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.inventory.GuiContainerCreative;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;

public class ItemRenderMosina implements IItemRenderer {
 
 
 
 
 int animpogress;
 int sprintanimpogress;
 int aimanimpogress;
 int snikanimpogress;
 float r;
 float tr;
 float rez;
 float rg;
 float aimr;
 float aimt;
 float rz;
 boolean debug;
 
 private ModelMosina model;
 private ModelHand modelHand; 
 private Random rnd = new Random();
 private static final ResourceLocation ModelTexture = new ResourceLocation("zp:textures/weapons/models/mosina.png");
 public ItemRenderMosina(){
 model = new ModelMosina();
 modelHand = new ModelHand();
 }
 
 @Override
 public boolean handleRenderType(ItemStack item, ItemRenderType type){
 switch(type){
 case EQUIPPED: return true;
 case EQUIPPED_FIRST_PERSON: return true;
 case ENTITY: return true;
 default: return false;
 }
 }
 
 @Override
 public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper){
 return false;
 }
 
 @Override
 public void renderItem(ItemRenderType type, ItemStack item, Object... data){
 
 
 switch(type)
 {
 
 
 case EQUIPPED_FIRST_PERSON:
 {
 GL11.glPushMatrix();
 
 boolean isFirstPerson = false;
 
 if(data[1] != null && data[1] instanceof EntityPlayer)
 {
 
 if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)))
 {
 GL11.glPushMatrix();
 
 float scale = 0.65F;
 GL11.glScalef(scale, scale, scale);
 
 GL11.glRotatef(15.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(-170.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-105.0F, 0.0F, 1.0F, 0.0F);
 
 GL11.glTranslatef(0.45F, -0.20F, 0.7F);
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 
 GL11.glPopMatrix();
 
 }else{
 
 
 if(Minecraft.getMinecraft().thePlayer.isSprinting()){
 sprintanimpogress++;
 if(sprintanimpogress<25){
 r+=1F;
 rez+=r;

 }
 
 GL11.glRotatef(r, 0.0F, 1.0F, 0.0F); 
 GL11.glRotatef(-r/2, 0.0F, 0.0F, 1.0F); 
 }else{sprintanimpogress=0; r=0; rez=0;}
 
 
 //для дебага
 if(!ZProject.isReload){
 ZProject.isReload =!ZProject.isReload;
 }
 
 if(Mouse.isButtonDown(1)){
 aimanimpogress++;
 if(aimanimpogress<7){
 aimr+=0.9F; 
 aimt+=0.089F;
 }
 
 
 GL11.glTranslatef(0.0F-aimt/2.1F, 0.0F+aimt/5, 0.0F-aimt*1.03F);
 GL11.glRotatef(-aimr, 0.0F, 1.0F, 0.0F); 
 GL11.glRotatef(-aimr/2, 0.0F, 0.0F, 1.0F); 
 
 
 }else{aimanimpogress=0; aimr=0; aimt=0;}

 
 
 
 if(ZProject.isShoting){
 if(animpogress<30){rg+=0.5F;}else if(animpogress<120 && animpogress>90){
 rg-=0.5F;
 }
 }else{rg=0;}
 GL11.glRotatef(-rg, 0.0F, 0.0F, 1.0F);
 
 GL11.glPushMatrix(); 
 float scale = 0.55F;
 GL11.glScalef(scale, scale, scale); 
 GL11.glRotatef(-00.0F, 1.0F, 0.0F, 0.0F);
 
 GL11.glRotatef(-152.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-180.0F, 0.0F, 1.0F, 0.0F); 
 GL11.glTranslatef(0.9F, -0.64F, 0.75F);
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 
 
 GL11.glPushMatrix(); 
 float scale1 = 0.55F;
 GL11.glScalef(scale1, scale1, scale1); 
 GL11.glRotatef(-00.0F, 1.0F, 0.0F, 0.0F);

 GL11.glRotatef(-152.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-180.0F, 0.0F, 1.0F, 0.0F); 
 GL11.glTranslatef(0.9F, -0.87F, 0.77F);
 
 if(ZProject.isShoting){
 animpogress++;
 if(animpogress<30){
 
 rz+=4.5F;
 rez-=rz;
 //GL11.glRotatef(0-rz, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }else if(animpogress<60){
 tr-=0.02F;
 GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<90){
 tr+=0.02F;
 GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<120){
 rz-=4.5F;
 rez-=rz;
 //GL11.glRotatef(0-rz, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }
 
 
 
 
 
 else{rz=0; tr=0; animpogress=0; rez = 0; ZProject.isShoting =!ZProject.isShoting;}
 GL11.glRotatef(0-rz, 1.0F, 0.0F, 0.0F);
 }
 
 
 
 
 
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.renderZatvor((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 
 
 
 
 
 
 
 GL11.glPushMatrix(); 
 
 if(ZProject.isReload){
 // if(r<50){r++;}else{r=0; ZProject.isReload = !ZProject.isReload;} 
 }
 
 
 float scaleq = 1.5F;
 GL11.glScalef(scaleq, scaleq, scaleq);
 GL11.glRotatef(135.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-40.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
 GL11.glTranslatef(-0.51F, 0.0F, -0.8F);
 EntityClientPlayerMP entityclientplayermp = Minecraft.getMinecraft().thePlayer;  Minecraft.getMinecraft().getTextureManager().bindTexture(entityclientplayermp.getLocationSkin());
 modelHand.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 
 
 
 GL11.glPushMatrix(); 
 float scaleq1 = 1.1F;
 GL11.glScalef(scaleq1, scaleq1, scaleq1); 
 GL11.glRotatef(125.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(10.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
 GL11.glTranslatef(-0.27F, -0.11F, -0.275F);
 Minecraft.getMinecraft().getTextureManager().bindTexture(entityclientplayermp.getLocationSkin());


 
 
 if(ZProject.isShoting &&  Minecraft.getMinecraft().gameSettings.thirdPersonView == 0){
 animpogress++;
 
 if(animpogress<120){
 
 if(animpogress<30){
 //GL11.glRotatef(0-r, 1.0F, 0.0F, 0.0F);
 tr-=0.000001F;
 //rez-=tr; 
 
 }
 GL11.glTranslatef(0.15F+tr*-2/4, -0.15F-tr, 0.1F+-tr/4);
 
 
 }/*else if(animpogress<60){
 GL11.glTranslatef(0.25F, 0, 0);
 tr-=0.02F;
 //GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 //GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<90){
 tr+=0.02F;
 //GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 //GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<120){
 r-=4.5F;
 rez-=r;
 //GL11.glRotatef(0-r, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }*/
 
 
 
 
 
 else{r=0; tr=0; animpogress=0; rez = 0; ZProject.isShoting =!ZProject.isShoting;}
 }
 
 modelHand.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 
 
 }}GL11.glPopMatrix();}
 case EQUIPPED:{
 if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)))
 {
 GL11.glPushMatrix();
 
 float scale = 0.65F;
 GL11.glScalef(scale, scale, scale-0.1F);
 
 GL11.glRotatef(15.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(-170.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-105.0F, 0.0F, 1.0F, 0.0F);
 
 GL11.glTranslatef(0.45F, -0.20F, 0.65F);
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPushMatrix();
 GL11.glTranslatef(0.0F, -0.20F, 0.0F);
 //model.renderZatvor((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 if(ZProject.isShoting){
 animpogress++;
 if(animpogress<30){
 
 r+=4.5F;
 rez-=r;
 GL11.glRotatef(0-r, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }else if(animpogress<60){
 tr-=0.02F;
 GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<90){
 tr+=0.02F;
 GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<120){
 r-=4.5F;
 rez-=r;
 GL11.glRotatef(0-r, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }
 
 
 
 
 
 else{r=0; tr=0; animpogress=0; rez = 0; ZProject.isShoting =!ZProject.isShoting;}
 }
 
 
 
 
 
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.renderZatvor((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 GL11.glPopMatrix();
 
 }
 }
 case ENTITY:
 {
 
 
 GL11.glPushMatrix();

 //TODO ModelRenderItem 
 GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
 GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F);

 boolean isFirstPerson = false;

 if(data[1] != null && data[1] instanceof EntityPlayer)
 {


 }
 else
 {
 float scale = 0.575F;
 GL11.glScalef(scale, scale, scale);

 GL11.glTranslatef(0F, 0F, 0.2F);
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);


 }



 GL11.glPopMatrix();

 }
 default: break;
 }
 }
 
 

}
[hr]
Вытащи из него что нужно.
 
Сообщения
51
Лучшие ответы
0
Реакции
0
Develance написал(а):
Мдаа, ну и ужас код.
Вот смотри, все действия с моделью(будто это поворот\положение\размер) ты должен делать в матрице, где рендерится сама модель.
Допустим:
Код:
GL11.glPushMatrix();
//транслейты всякие и тп
//условие
model.renderAll():
Gl11.glPopMatrix();
А вообще держи рендер с ZProject'a(все равно закрылся)
Код:
package ZProject.ZEngine.Weapons.Renderers;

import java.util.Random;

import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;

import ZProject.ZProject;
import ZProject.ZEngine.Weapons.Models.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.gui.inventory.GuiContainerCreative;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;

public class ItemRenderMosina implements IItemRenderer {
 
 
 
 
 int animpogress;
 int sprintanimpogress;
 int aimanimpogress;
 int snikanimpogress;
 float r;
 float tr;
 float rez;
 float rg;
 float aimr;
 float aimt;
 float rz;
 boolean debug;
 
 private ModelMosina model;
 private ModelHand modelHand; 
 private Random rnd = new Random();
 private static final ResourceLocation ModelTexture = new ResourceLocation("zp:textures/weapons/models/mosina.png");
 public ItemRenderMosina(){
 model = new ModelMosina();
 modelHand = new ModelHand();
 }
 
 @Override
 public boolean handleRenderType(ItemStack item, ItemRenderType type){
 switch(type){
 case EQUIPPED: return true;
 case EQUIPPED_FIRST_PERSON: return true;
 case ENTITY: return true;
 default: return false;
 }
 }
 
 @Override
 public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper){
 return false;
 }
 
 @Override
 public void renderItem(ItemRenderType type, ItemStack item, Object... data){
 
 
 switch(type)
 {
 
 
 case EQUIPPED_FIRST_PERSON:
 {
 GL11.glPushMatrix();
 
 boolean isFirstPerson = false;
 
 if(data[1] != null && data[1] instanceof EntityPlayer)
 {
 
 if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)))
 {
 GL11.glPushMatrix();
 
 float scale = 0.65F;
 GL11.glScalef(scale, scale, scale);
 
 GL11.glRotatef(15.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(-170.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-105.0F, 0.0F, 1.0F, 0.0F);
 
 GL11.glTranslatef(0.45F, -0.20F, 0.7F);
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 
 GL11.glPopMatrix();
 
 }else{
 
 
 if(Minecraft.getMinecraft().thePlayer.isSprinting()){
 sprintanimpogress++;
 if(sprintanimpogress<25){
 r+=1F;
 rez+=r;

 }
 
 GL11.glRotatef(r, 0.0F, 1.0F, 0.0F); 
 GL11.glRotatef(-r/2, 0.0F, 0.0F, 1.0F); 
 }else{sprintanimpogress=0; r=0; rez=0;}
 
 
 //для дебага
 if(!ZProject.isReload){
 ZProject.isReload =!ZProject.isReload;
 }
 
 if(Mouse.isButtonDown(1)){
 aimanimpogress++;
 if(aimanimpogress<7){
 aimr+=0.9F; 
 aimt+=0.089F;
 }
 
 
 GL11.glTranslatef(0.0F-aimt/2.1F, 0.0F+aimt/5, 0.0F-aimt*1.03F);
 GL11.glRotatef(-aimr, 0.0F, 1.0F, 0.0F); 
 GL11.glRotatef(-aimr/2, 0.0F, 0.0F, 1.0F); 
 
 
 }else{aimanimpogress=0; aimr=0; aimt=0;}

 
 
 
 if(ZProject.isShoting){
 if(animpogress<30){rg+=0.5F;}else if(animpogress<120 && animpogress>90){
 rg-=0.5F;
 }
 }else{rg=0;}
 GL11.glRotatef(-rg, 0.0F, 0.0F, 1.0F);
 
 GL11.glPushMatrix(); 
 float scale = 0.55F;
 GL11.glScalef(scale, scale, scale); 
 GL11.glRotatef(-00.0F, 1.0F, 0.0F, 0.0F);
 
 GL11.glRotatef(-152.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-180.0F, 0.0F, 1.0F, 0.0F); 
 GL11.glTranslatef(0.9F, -0.64F, 0.75F);
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 
 
 GL11.glPushMatrix(); 
 float scale1 = 0.55F;
 GL11.glScalef(scale1, scale1, scale1); 
 GL11.glRotatef(-00.0F, 1.0F, 0.0F, 0.0F);

 GL11.glRotatef(-152.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-180.0F, 0.0F, 1.0F, 0.0F); 
 GL11.glTranslatef(0.9F, -0.87F, 0.77F);
 
 if(ZProject.isShoting){
 animpogress++;
 if(animpogress<30){
 
 rz+=4.5F;
 rez-=rz;
 //GL11.glRotatef(0-rz, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }else if(animpogress<60){
 tr-=0.02F;
 GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<90){
 tr+=0.02F;
 GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<120){
 rz-=4.5F;
 rez-=rz;
 //GL11.glRotatef(0-rz, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }
 
 
 
 
 
 else{rz=0; tr=0; animpogress=0; rez = 0; ZProject.isShoting =!ZProject.isShoting;}
 GL11.glRotatef(0-rz, 1.0F, 0.0F, 0.0F);
 }
 
 
 
 
 
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.renderZatvor((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 
 
 
 
 
 
 
 GL11.glPushMatrix(); 
 
 if(ZProject.isReload){
 // if(r<50){r++;}else{r=0; ZProject.isReload = !ZProject.isReload;} 
 }
 
 
 float scaleq = 1.5F;
 GL11.glScalef(scaleq, scaleq, scaleq);
 GL11.glRotatef(135.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-40.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
 GL11.glTranslatef(-0.51F, 0.0F, -0.8F);
 EntityClientPlayerMP entityclientplayermp = Minecraft.getMinecraft().thePlayer;  Minecraft.getMinecraft().getTextureManager().bindTexture(entityclientplayermp.getLocationSkin());
 modelHand.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 
 
 
 GL11.glPushMatrix(); 
 float scaleq1 = 1.1F;
 GL11.glScalef(scaleq1, scaleq1, scaleq1); 
 GL11.glRotatef(125.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(10.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
 GL11.glTranslatef(-0.27F, -0.11F, -0.275F);
 Minecraft.getMinecraft().getTextureManager().bindTexture(entityclientplayermp.getLocationSkin());


 
 
 if(ZProject.isShoting &&  Minecraft.getMinecraft().gameSettings.thirdPersonView == 0){
 animpogress++;
 
 if(animpogress<120){
 
 if(animpogress<30){
 //GL11.glRotatef(0-r, 1.0F, 0.0F, 0.0F);
 tr-=0.000001F;
 //rez-=tr; 
 
 }
 GL11.glTranslatef(0.15F+tr*-2/4, -0.15F-tr, 0.1F+-tr/4);
 
 
 }/*else if(animpogress<60){
 GL11.glTranslatef(0.25F, 0, 0);
 tr-=0.02F;
 //GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 //GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<90){
 tr+=0.02F;
 //GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 //GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<120){
 r-=4.5F;
 rez-=r;
 //GL11.glRotatef(0-r, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }*/
 
 
 
 
 
 else{r=0; tr=0; animpogress=0; rez = 0; ZProject.isShoting =!ZProject.isShoting;}
 }
 
 modelHand.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 
 
 }}GL11.glPopMatrix();}
 case EQUIPPED:{
 if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F)))
 {
 GL11.glPushMatrix();
 
 float scale = 0.65F;
 GL11.glScalef(scale, scale, scale-0.1F);
 
 GL11.glRotatef(15.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(-170.0F, 0.0F, 0.0F, 1.0F);
 GL11.glRotatef(-105.0F, 0.0F, 1.0F, 0.0F);
 
 GL11.glTranslatef(0.45F, -0.20F, 0.65F);
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPushMatrix();
 GL11.glTranslatef(0.0F, -0.20F, 0.0F);
 //model.renderZatvor((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 if(ZProject.isShoting){
 animpogress++;
 if(animpogress<30){
 
 r+=4.5F;
 rez-=r;
 GL11.glRotatef(0-r, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }else if(animpogress<60){
 tr-=0.02F;
 GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<90){
 tr+=0.02F;
 GL11.glRotatef(rez/5, 1.0F, 0.0F, 0.0F);
 GL11.glTranslatef(0+tr, 0, 0);
 }else if(animpogress<120){
 r-=4.5F;
 rez-=r;
 GL11.glRotatef(0-r, 1.0F, 0.0F, 0.0F);
 tr-=0.001F;
 //GL11.glTranslatef(0, 0, 0+tr);
 }
 
 
 
 
 
 else{r=0; tr=0; animpogress=0; rez = 0; ZProject.isShoting =!ZProject.isShoting;}
 }
 
 
 
 
 
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.renderZatvor((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
 GL11.glPopMatrix();
 GL11.glPopMatrix();
 
 }
 }
 case ENTITY:
 {
 
 
 GL11.glPushMatrix();

 //TODO ModelRenderItem 
 GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
 GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
 GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F);

 boolean isFirstPerson = false;

 if(data[1] != null && data[1] instanceof EntityPlayer)
 {


 }
 else
 {
 float scale = 0.575F;
 GL11.glScalef(scale, scale, scale);

 GL11.glTranslatef(0F, 0F, 0.2F);
 Minecraft.getMinecraft().renderEngine.bindTexture(ModelTexture);
 model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);


 }



 GL11.glPopMatrix();

 }
 default: break;
 }
 }
 
 

}
[hr]
Вытащи из него что нужно.
Спасибо, сейчас попробую! Все действительно работает! Спасибо большое!
 
Сверху