MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Armure avec rendu 3d

    Planifier Épinglé Verrouillé Déplacé Résolu 1.8.x
    1.8.9
    19 Messages 3 Publieurs 3.1k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • E Hors-ligne
      elx9000
      dernière édition par

      Salut à tous, dans mon mod j’essais de rajouter une pièce d’armure avec un rendu 3d, j’essais de faire des palmes. Le souci c’est que cette pièce d’armur de suit pas les mouvements du joueur (avancer, reculer, s’accroupir…) , cependant elle reste à la position du joueur, mes classes :

      ClientProxy

      
      package com.survivant.mod.proxy;
      
      import java.util.HashMap;
      import java.util.Map;
      
      import com.survivant.mod.ModSurvivant;
      import com.survivant.mod.Reference;
      import com.survivant.mod.blocks.BlockMod;
      import com.survivant.mod.entity.EntityFish;
      import com.survivant.mod.entity.EntitySalmon;
      import com.survivant.mod.handlers.EntityHandler;
      import com.survivant.mod.items.ItemMod;
      import com.survivant.mod.models.ModelArmorFlippers;
      import com.survivant.mod.models.ModelFish;
      import com.survivant.mod.models.ModelSalmon;
      import com.survivant.mod.render.RenderFish;
      import com.survivant.mod.render.RenderSalmon;
      
      import net.minecraft.block.Block;
      import net.minecraft.block.state.IBlockState;
      import net.minecraft.client.Minecraft;
      import net.minecraft.client.model.ModelBiped;
      import net.minecraft.client.renderer.ItemMeshDefinition;
      import net.minecraft.client.renderer.block.statemap.StateMapperBase;
      import net.minecraft.client.resources.model.ModelBakery;
      import net.minecraft.client.resources.model.ModelResourceLocation;
      import net.minecraft.item.Item;
      import net.minecraft.item.ItemStack;
      import net.minecraftforge.client.model.ModelLoader;
      import net.minecraftforge.fluids.BlockFluidClassic;
      import net.minecraftforge.fml.client.registry.RenderingRegistry;
      
      public class ClientProxy extends CommonProxy
      {    
          public static final Map <item, modelbiped="">armorModels = new HashMap<item, modelbiped="">();
      
          @Override
          public void registerRenders()
          {
              ItemMod.registerRenders();
              BlockMod.registerRenders();
      
              RenderingRegistry.registerEntityRenderingHandler(EntityFish.class, new RenderFish(Minecraft.getMinecraft().getRenderManager(), new ModelFish(), 0.5F));
              RenderingRegistry.registerEntityRenderingHandler(EntitySalmon.class, new RenderSalmon(Minecraft.getMinecraft().getRenderManager(), new ModelSalmon(), 0.5F));
      
              ModelArmorFlippers armorFlippers = new ModelArmorFlippers();
              armorModels.put(ItemMod.itemArmorFlippers, armorFlippers);
          }
      
      }
      
      

      ModelArmorFlippers (le model)

      
      package com.survivant.mod.models;
      
      import net.minecraft.client.model.ModelBiped;
      import net.minecraft.client.model.ModelRenderer;
      import net.minecraft.entity.Entity;
      import net.minecraft.util.MathHelper;
      
      public class ModelArmorFlippers extends ModelBiped
      {
        //fields
          ModelRenderer flippersRight1;
          ModelRenderer flippersRight2;
          ModelRenderer flippersRight3;
          ModelRenderer flippersRight4;
          ModelRenderer flippersRight5;
          ModelRenderer flippersLeft1;
          ModelRenderer flippersLeft2;
          ModelRenderer flippersLeft3;
          ModelRenderer flippersLeft4;
          ModelRenderer flippersLeft5;
      
        public ModelArmorFlippers()
        {
          textureWidth = 64;
          textureHeight = 64;
      
            flippersRight1 = new ModelRenderer(this, 1, 37);
            flippersRight1.addBox(-2F, 8F, -2F, 0, 4, 4);
            flippersRight1.setRotationPoint(2F, 12F, 0F);
            flippersRight1.setTextureSize(64, 64);
            flippersRight1.mirror = true;
            setRotation(flippersRight1, 0F, 0F, 0F);
            flippersRight2 = new ModelRenderer(this, 17, 37);
            flippersRight2.addBox(2F, 8F, -2F, 0, 4, 4);
            flippersRight2.setRotationPoint(2F, 12F, 0F);
            flippersRight2.setTextureSize(64, 64);
            flippersRight2.mirror = true;
            setRotation(flippersRight2, 0F, 0F, 0F);
            flippersRight3 = new ModelRenderer(this, 9, 34);
            flippersRight3.addBox(-2F, 8F, 2F, 4, 4, 0);
            flippersRight3.setRotationPoint(2F, 12F, 0F);
            flippersRight3.setTextureSize(64, 64);
            flippersRight3.mirror = true;
            setRotation(flippersRight3, 0F, 0F, 0F);
            flippersRight4 = new ModelRenderer(this, 9, 44);
            flippersRight4.addBox(-2F, 8F, -2F, 4, 4, 0);
            flippersRight4.setRotationPoint(2F, 12F, 0F);
            flippersRight4.setTextureSize(64, 64);
            flippersRight4.mirror = true;
            setRotation(flippersRight4, 0F, 0F, 0F);
            flippersRight5 = new ModelRenderer(this, 31, 35);
            flippersRight5.addBox(-2F, 12F, -10F, 4, 0, 12);
            flippersRight5.setRotationPoint(2F, 12F, 0F);
            flippersRight5.setTextureSize(64, 64);
            flippersRight5.mirror = true;
            setRotation(flippersRight5, 0F, 0F, 0F);
            flippersLeft1 = new ModelRenderer(this, 1, 53);
            flippersLeft1.addBox(-2F, 8F, -2F, 0, 4, 4);
            flippersLeft1.setRotationPoint(-2F, 12F, 0F);
            flippersLeft1.setTextureSize(64, 64);
            flippersLeft1.mirror = true;
            setRotation(flippersLeft1, 0F, 0F, 0F);
            flippersLeft2 = new ModelRenderer(this, 17, 53);
            flippersLeft2.addBox(2F, 8F, -2F, 0, 4, 4);
            flippersLeft2.setRotationPoint(-2F, 12F, 0F);
            flippersLeft2.setTextureSize(64, 64);
            flippersLeft2.mirror = true;
            setRotation(flippersLeft2, 0F, 0F, 0F);
            flippersLeft3 = new ModelRenderer(this, 9, 50);
            flippersLeft3.addBox(-2F, 8F, 2F, 4, 4, 0);
            flippersLeft3.setRotationPoint(-2F, 12F, 0F);
            flippersLeft3.setTextureSize(64, 64);
            flippersLeft3.mirror = true;
            setRotation(flippersLeft3, 0F, 0F, 0F);
            flippersLeft4 = new ModelRenderer(this, 9, 59);
            flippersLeft4.addBox(-2F, 8F, -2F, 4, 4, 0);
            flippersLeft4.setRotationPoint(-2F, 12F, 0F);
            flippersLeft4.setTextureSize(64, 64);
            flippersLeft4.mirror = true;
            setRotation(flippersLeft4, 0F, 0F, 0F);
            flippersLeft5 = new ModelRenderer(this, 31, 50);
            flippersLeft5.addBox(-2F, 12F, -10F, 4, 0, 12);
            flippersLeft5.setRotationPoint(-2F, 12F, 0F);
            flippersLeft5.setTextureSize(64, 64);
            flippersLeft5.mirror = true;
            setRotation(flippersLeft5, 0F, 0F, 0F);
        }
      
        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);
          flippersRight1.render(f5);
          flippersRight2.render(f5);
          flippersRight3.render(f5);
          flippersRight4.render(f5);
          flippersRight5.render(f5);
          flippersLeft1.render(f5);
          flippersLeft2.render(f5);
          flippersLeft3.render(f5);
          flippersLeft4.render(f5);
          flippersLeft5.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 f, float f1, float f2, float f3, float f4, float f5, Entity entity)
        {
          super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
        }
      
      }
      
      

      ItemArmorFlippers (la classe de l’item)

      
      package com.survivant.mod.items;
      
      import com.survivant.mod.Reference;
      import com.survivant.mod.models.ModelArmorFlippers;
      import com.survivant.mod.proxy.ClientProxy;
      
      import net.minecraft.client.model.ModelBiped;
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.EntityLivingBase;
      import net.minecraft.entity.player.EntityPlayer;
      import net.minecraft.item.EnumAction;
      import net.minecraft.item.ItemArmor;
      import net.minecraft.item.ItemStack;
      import net.minecraftforge.fml.relauncher.Side;
      import net.minecraftforge.fml.relauncher.SideOnly;
      
      public class ItemArmorFlippers extends ItemArmor
      {
      
          public ItemArmorFlippers(ArmorMaterial material, int armorType)
          {
              super(material, 0, armorType);
          }
      
          @Override
          public String getUnlocalizedName()
          {
              return String.format("item.%s", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
          }
      
          @Override
          public String getUnlocalizedName(ItemStack itemstack)
          {
              return String.format("item.%s", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
          }
      
          protected String getUnwrappedUnlocalizedName(String unlocalizedName)
          {
              return unlocalizedName.substring(unlocalizedName.indexOf('.') + 1);
          }
      
          @Override
          @SideOnly(Side.CLIENT)
          public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot)
          {
              ModelBiped armorModel = ClientProxy.armorModels.get(this);
      
              if (armorModel != null)
              {
                  armorModel.bipedHead.showModel = armorSlot == 0;
                  armorModel.bipedHeadwear.showModel = armorSlot == 0;
                  armorModel.bipedBody.showModel = armorSlot == 1 || armorSlot == 2;
                  armorModel.bipedRightArm.showModel = armorSlot == 1;
                  armorModel.bipedLeftArm.showModel = armorSlot == 1;
                  armorModel.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3;
                  armorModel.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3;
      
                  armorModel.isSneak = entityLiving.isSneaking();
                  armorModel.isRiding = entityLiving.isRiding();
                  armorModel.isChild = entityLiving.isChild();
      
                  armorModel.swingProgress = entityLiving.swingProgress;
      
                  armorModel.heldItemRight = 0;
                  armorModel.aimedBow = false;
      
                  EntityPlayer player = (EntityPlayer)entityLiving;
                  ItemStack held_item = player.getEquipmentInSlot(0);
      
                  if (held_item != null)
                  {
                      armorModel.heldItemRight = 1;
      
                      if (player.getItemInUseCount() > 0)
                      {
                          EnumAction enumaction = held_item.getItemUseAction();
      
                          if (enumaction == EnumAction.BOW)
                          {
                              armorModel.aimedBow = true;
                          }
                          else if (enumaction == EnumAction.BLOCK)
                          {
                              armorModel.heldItemRight = 3;
                          }
                      }
                      return armorModel;
                  }
              }
              return armorModel;
          }
      
          public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
          {
              if(stack.getItem() == ItemMod.itemArmorFlippers)
              {
                  return Reference.MOD_ID + ":textures/models/armor/survivalArmor_layer_flippers.png";
              }
              return null;
          }
      }
      
      

      Merci, d’avance de votre aide.

      Petit screen (exemple du sneak)</item,></item,>

      1 réponse Dernière réponse Répondre Citer 0
      • robin4002R Hors-ligne
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
        dernière édition par

        Salut,

                   armorModel.isSneak = entityLiving.isSneaking();
                   armorModel.isRiding = entityLiving.isRiding();
                   armorModel.isChild = entityLiving.isChild();
        

        Ici tu fais en sorte que la variable isSneak de ton armure ait la même valeur que entityLiving.isSneaking().
        Le problème c’est que dans le code du rendu de ton armure tu ne fais rien avec isSneak.
        Lances ton jeu en debug et dans la fonction setRotationAngles de ton armure effectue les rotation ou translation nécessaire en fonction de isSneak.

        Je te laisse jeter un coup d’œil à ModelBiped, l’armure de minecraft utilise ModelBiped.

        1 réponse Dernière réponse Répondre Citer 0
        • E Hors-ligne
          elx9000
          dernière édition par

          Pour ce qui est du sneak sa fonctionne, en effet j’ai mis ça dans la fonction setRotationAngles : (j’en ai aussi profité pour changer le model)

          
                super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
          
                if (this.isSneak)
                {
                    this.flippersLeft1.rotationPointY = 12.0F;
                    this.flippersLeft2.rotationPointY = 12.0F;
          
                    this.flippersLeft1.rotationPointZ = 4.0F;
                    this.flippersLeft2.rotationPointZ = 4.0F;
          
                    this.flippersRight1.rotationPointY = 12.0F;
                    this.flippersRight2.rotationPointY = 12.0F;
          
                    this.flippersRight1.rotationPointZ = 4.0F;
                    this.flippersRight2.rotationPointZ = 4.0F;
                }
                else 
                {
                    this.flippersLeft1.rotationPointY = 12.0F;
                    this.flippersLeft2.rotationPointY = 12.0F;
          
                    this.flippersLeft1.rotationPointZ = 0.1F;
                    this.flippersLeft2.rotationPointZ = 0.1F;
          
                    this.flippersRight1.rotationPointY = 12.0F;
                    this.flippersRight2.rotationPointY = 12.0F;
          
                    this.flippersRight1.rotationPointZ = 0.1F;
                    this.flippersRight2.rotationPointZ = 0.1F;
                }
          
          ``` 
          
          Cependant, quand j'avance en jeu les palmes ne suivent pas les pieds du joueurs, comment faire ?
          1 réponse Dernière réponse Répondre Citer 0
          • robin4002R Hors-ligne
            robin4002 Moddeurs confirmés Rédacteurs Administrateurs
            dernière édition par

            Il faut modifier les valeurs de rotation de chaque morceau dans la fonction setRotationAngles.
            à titre d’exemple la classe ModelBiped :

            public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entityIn)
            {
            this.bipedHead.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI);
            this.bipedHead.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI);
            this.bipedRightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 2.0F * p_78087_2_ * 0.5F;
            this.bipedLeftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F;
            this.bipedRightArm.rotateAngleZ = 0.0F;
            this.bipedLeftArm.rotateAngleZ = 0.0F;
            this.bipedRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_;
            this.bipedLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_;
            this.bipedRightLeg.rotateAngleY = 0.0F;
            this.bipedLeftLeg.rotateAngleY = 0.0F;
            
            if (this.isRiding)
            {
            this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F);
            this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F);
            this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F);
            this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F);
            this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F);
            this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F);
            }
            
            if (this.heldItemLeft != 0)
            {
            this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft;
            }
            
            this.bipedRightArm.rotateAngleY = 0.0F;
            this.bipedRightArm.rotateAngleZ = 0.0F;
            
            switch (this.heldItemRight)
            {
            case 0:
            case 2:
            default:
            break;
            case 1:
            this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight;
            break;
            case 3:
            this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight;
            this.bipedRightArm.rotateAngleY = -0.5235988F;
            }
            
            this.bipedLeftArm.rotateAngleY = 0.0F;
            
            if (this.swingProgress > -9990.0F)
            {
            float f = this.swingProgress;
            this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(f) * (float)Math.PI * 2.0F) * 0.2F;
            this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
            this.bipedRightArm.rotationPointX = -MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
            this.bipedLeftArm.rotationPointZ = -MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F;
            this.bipedLeftArm.rotationPointX = MathHelper.cos(this.bipedBody.rotateAngleY) * 5.0F;
            this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY;
            this.bipedLeftArm.rotateAngleY += this.bipedBody.rotateAngleY;
            this.bipedLeftArm.rotateAngleX += this.bipedBody.rotateAngleY;
            f = 1.0F - this.swingProgress;
            f = f * f;
            f = f * f;
            f = 1.0F - f;
            float f1 = MathHelper.sin(f * (float)Math.PI);
            float f2 = MathHelper.sin(this.swingProgress * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F;
            this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)f1 * 1.2D + (double)f2));
            this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F;
            this.bipedRightArm.rotateAngleZ += MathHelper.sin(this.swingProgress * (float)Math.PI) * -0.4F;
            }
            
            if (this.isSneak)
            {
            this.bipedBody.rotateAngleX = 0.5F;
            this.bipedRightArm.rotateAngleX += 0.4F;
            this.bipedLeftArm.rotateAngleX += 0.4F;
            this.bipedRightLeg.rotationPointZ = 4.0F;
            this.bipedLeftLeg.rotationPointZ = 4.0F;
            this.bipedRightLeg.rotationPointY = 9.0F;
            this.bipedLeftLeg.rotationPointY = 9.0F;
            this.bipedHead.rotationPointY = 1.0F;
            }
            else
            {
            this.bipedBody.rotateAngleX = 0.0F;
            this.bipedRightLeg.rotationPointZ = 0.1F;
            this.bipedLeftLeg.rotationPointZ = 0.1F;
            this.bipedRightLeg.rotationPointY = 12.0F;
            this.bipedLeftLeg.rotationPointY = 12.0F;
            this.bipedHead.rotationPointY = 0.0F;
            }
            
            this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
            this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
            this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
            this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
            
            if (this.aimedBow)
            {
            float f3 = 0.0F;
            float f4 = 0.0F;
            this.bipedRightArm.rotateAngleZ = 0.0F;
            this.bipedLeftArm.rotateAngleZ = 0.0F;
            this.bipedRightArm.rotateAngleY = -(0.1F - f3 * 0.6F) + this.bipedHead.rotateAngleY;
            this.bipedLeftArm.rotateAngleY = 0.1F - f3 * 0.6F + this.bipedHead.rotateAngleY + 0.4F;
            this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
            this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX;
            this.bipedRightArm.rotateAngleX -= f3 * 1.2F - f4 * 0.4F;
            this.bipedLeftArm.rotateAngleX -= f3 * 1.2F - f4 * 0.4F;
            this.bipedRightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
            this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
            this.bipedRightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
            this.bipedLeftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
            }
            
            copyModelAngles(this.bipedHead, this.bipedHeadwear);
            }
            
            1 réponse Dernière réponse Répondre Citer 0
            • E Hors-ligne
              elx9000
              dernière édition par

              Comme je fait des palmes, je n’est besoin que des rotations concernant les 2 jambes, quand j’ai mis ça :

              
                      this.bipedRightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_;
                      this.bipedLeftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_;
                      this.bipedRightLeg.rotateAngleY = 0.0F;
                      this.bipedLeftLeg.rotateAngleY = 0.0F;
              
              

              en modifiant bipedRightLeg et BipedLeftLeg par mes composants d’armure, en jeu les palmes tournée autour du perso verticalement et tout le temps, 
              Dois-je modifier les valeurs des float p_78087_1_ et  p_78087_2_ ?

              1 réponse Dernière réponse Répondre Citer 0
              • robin4002R Hors-ligne
                robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                dernière édition par

                Tu peux envoyer un gif ?
                à mon avis il faut changer l’angle de rotation.

                1 réponse Dernière réponse Répondre Citer 0
                • E Hors-ligne
                  elx9000
                  dernière édition par

                  Désoler je me suis tromper je l’ai refait voilà :

                  1 réponse Dernière réponse Répondre Citer 0
                  • BrokenSwingB Hors-ligne
                    BrokenSwing Moddeurs confirmés Rédacteurs
                    dernière édition par

                    Ça c’est le lien de pour créer un gif me semble-t-il

                    1 réponse Dernière réponse Répondre Citer 0
                    • robin4002R Hors-ligne
                      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                      dernière édition par

                      Le point de rotation de ton modèle n’est pas au bon endroit.

                      1 réponse Dernière réponse Répondre Citer 0
                      • E Hors-ligne
                        elx9000
                        dernière édition par

                        D’accord mais comment je sais ou elle doit - être ?

                        1 réponse Dernière réponse Répondre Citer 0
                        • robin4002R Hors-ligne
                          robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                          dernière édition par

                          Au même niveau que les jambes du joueur.

                          1 réponse Dernière réponse Répondre Citer 0
                          • E Hors-ligne
                            elx9000
                            dernière édition par

                            Pourtant dans mon code j’ai pris les rotations des jambes du Biped

                            1 réponse Dernière réponse Répondre Citer 0
                            • robin4002R Hors-ligne
                              robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                              dernière édition par

                              Quand tu fais ton modèle sur techne, le point bleu (point de rotation) doit être au même endroit que le point de rotation des jambes du joueur.
                              Donc au niveau de la limite entre le ventre et les jambes.

                              1 réponse Dernière réponse Répondre Citer 0
                              • E Hors-ligne
                                elx9000
                                dernière édition par

                                Oui ça je l’ai fait

                                1 réponse Dernière réponse Répondre Citer 0
                                • robin4002R Hors-ligne
                                  robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                  dernière édition par

                                  ça ne devrait pas faire ça alors.

                                  Envoies-moi un zip de ton dossier src, je vais faire des tests de mon côté.

                                  1 réponse Dernière réponse Répondre Citer 0
                                  • E Hors-ligne
                                    elx9000
                                    dernière édition par

                                    Tiens :

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • E Hors-ligne
                                      elx9000
                                      dernière édition par

                                      Alors une idée ? Parce que moi je suis complètement perdu.

                                      1 réponse Dernière réponse Répondre Citer 0
                                      • robin4002R Hors-ligne
                                        robin4002 Moddeurs confirmés Rédacteurs Administrateurs
                                        dernière édition par

                                        Désolé, j’avais complètement oublié de regarder.
                                        Pourquoi faire compliqué quand on peut faire simple ? Il suffit de reprendre l’angle des jambes :

                                        package com.survivant.mod.models;
                                        
                                        import net.minecraft.client.model.ModelBiped;
                                        import net.minecraft.client.model.ModelRenderer;
                                        import net.minecraft.entity.Entity;
                                        import net.minecraft.util.MathHelper;
                                        
                                        public class ModelArmorFlippers extends ModelBiped
                                        {
                                        // fields
                                        ModelRenderer flippersRight1;
                                        ModelRenderer flippersLeft1;
                                        ModelRenderer flippersRight2;
                                        ModelRenderer flippersLeft2;
                                        
                                        public ModelArmorFlippers()
                                        {
                                        textureWidth = 64;
                                        textureHeight = 64;
                                        
                                        flippersRight1 = new ModelRenderer(this, 37, 35);
                                        flippersRight1.addBox(-2F, 8F, -3F, 5, 4, 6);
                                        flippersRight1.setRotationPoint(2F, 12F, 0F);
                                        flippersRight1.setTextureSize(64, 64);
                                        flippersRight1.mirror = true;
                                        setRotation(flippersRight1, 0F, 0F, 0F);
                                        flippersLeft1 = new ModelRenderer(this, 5, 35);
                                        flippersLeft1.addBox(-3F, 8F, -3F, 5, 4, 6);
                                        flippersLeft1.setRotationPoint(-2F, 12F, 0F);
                                        flippersLeft1.setTextureSize(64, 64);
                                        flippersLeft1.mirror = true;
                                        setRotation(flippersLeft1, 0F, 0F, 0F);
                                        flippersRight2 = new ModelRenderer(this, 32, 45);
                                        flippersRight2.addBox(-2F, 11F, -13F, 5, 1, 11);
                                        flippersRight2.setRotationPoint(2F, 12F, 0F);
                                        flippersRight2.setTextureSize(64, 64);
                                        flippersRight2.mirror = true;
                                        setRotation(flippersRight2, 0F, -0.0743572F, 0F);
                                        flippersLeft2 = new ModelRenderer(this, 0, 45);
                                        flippersLeft2.addBox(-3F, 11F, -13F, 5, 1, 11);
                                        flippersLeft2.setRotationPoint(-2F, 12F, 0F);
                                        flippersLeft2.setTextureSize(64, 64);
                                        flippersLeft2.mirror = true;
                                        setRotation(flippersLeft2, 0F, 0.074351F, 0F);
                                        }
                                        
                                        public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
                                        {
                                        setRotationAngles(f, f1, f2, f3, f4, f5, entity);
                                        flippersRight1.render(f5);
                                        flippersLeft1.render(f5);
                                        flippersRight2.render(f5);
                                        flippersLeft2.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 f, float f1, float f2, float f3, float f4, float f5, Entity entity)
                                        {
                                        super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
                                        
                                        if(this.isSneak)
                                        {
                                        this.flippersLeft1.rotationPointY = 12.0F;
                                        this.flippersLeft2.rotationPointY = 12.0F;
                                        
                                        this.flippersLeft1.rotationPointZ = 4.0F;
                                        this.flippersLeft2.rotationPointZ = 4.0F;
                                        
                                        this.flippersRight1.rotationPointY = 12.0F;
                                        this.flippersRight2.rotationPointY = 12.0F;
                                        
                                        this.flippersRight1.rotationPointZ = 4.0F;
                                        this.flippersRight2.rotationPointZ = 4.0F;
                                        }
                                        else
                                        {
                                        this.flippersLeft1.rotationPointY = 12.0F;
                                        this.flippersLeft2.rotationPointY = 12.0F;
                                        
                                        this.flippersLeft1.rotationPointZ = 0.1F;
                                        this.flippersLeft2.rotationPointZ = 0.1F;
                                        
                                        this.flippersRight1.rotationPointY = 12.0F;
                                        this.flippersRight2.rotationPointY = 12.0F;
                                        
                                        this.flippersRight1.rotationPointZ = 0.1F;
                                        this.flippersRight2.rotationPointZ = 0.1F;
                                        }
                                        
                                        this.flippersLeft1.rotateAngleX = bipedRightLeg.rotateAngleX;
                                        this.flippersLeft2.rotateAngleX = bipedRightLeg.rotateAngleX;
                                        this.flippersLeft1.rotateAngleY = bipedRightLeg.rotateAngleY;
                                        this.flippersLeft2.rotateAngleY = bipedRightLeg.rotateAngleY;
                                        this.flippersRight1.rotateAngleX = bipedLeftLeg.rotateAngleX;
                                        this.flippersRight2.rotateAngleX = bipedLeftLeg.rotateAngleX;
                                        this.flippersRight1.rotateAngleY = bipedLeftLeg.rotateAngleY;
                                        this.flippersRight2.rotateAngleY = bipedLeftLeg.rotateAngleY;
                                        }
                                        }
                                        

                                        Par contre tu as visiblement inversé la droite et la gauche dans ton modèle.

                                        1 réponse Dernière réponse Répondre Citer 0
                                        • E Hors-ligne
                                          elx9000
                                          dernière édition par

                                          Ok, merci je test le code demain et je reviens si j’ai un souci

                                          Je viens de test, sa marche parfaitement, merci.

                                          1 réponse Dernière réponse Répondre Citer 0
                                          • 1 / 1
                                          • Premier message
                                            Dernier message
                                          Design by Woryk
                                          ContactMentions Légales

                                          MINECRAFT FORGE FRANCE © 2024

                                          Powered by NodeBB