MFF

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

    Problème rotation angles EntityMob.

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    10 Messages 6 Publieurs 1.9k 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.
    • GabsG Hors-ligne
      Gabs
      dernière édition par

      Bonsoir,
      J’ai un problème avec la rotation de mon entity, En gros:

      J’ai créer un renard rien de bien compliqué…
      La rotation de la tête des pattes et des oreilles ne sont pas buggé par contre la rotation du museau a un problème .

      En gros quand le renard tourne sa tête a droite le museau se décolle de la tête et quand il tourne sa tête a gauche elle rentre dans la tête du renard c’est assez bizarre du coup je vous montre des Screenshots .

      En conclusion:  Je veux juste que le museau de mon renard suive la tête quand elle tourne a droite a gauche, haut … , comme le loup en gros.

      http://puu.sh/kLtSC/a2a3f29276.png

      http://puu.sh/kLtXn/4f5ca438b6.png

      voilà le screen quand le renard est normal :

      http://puu.sh/kLu8m/a96f2f7985.png

      CODE:

      package com.ArmaGames.net;
      
      import net.minecraft.client.model.ModelBase;
      import net.minecraft.client.model.ModelRenderer;
      import net.minecraft.entity.Entity;
      import net.minecraft.util.MathHelper;
      
      public class Fox extends ModelBase
      {
          public ModelRenderer wolfHead;
          public ModelRenderer body;
          public ModelRenderer leg1;
          public ModelRenderer leg2;
          public ModelRenderer leg3;
          public ModelRenderer leg4;
          public ModelRenderer tail;
          public ModelRenderer ear1;
          public ModelRenderer ear2;
          public ModelRenderer shape1;
      
        public Fox()
        {
            this.textureWidth = 64;
            this.textureHeight = 32;
      
            this.wolfHead = new ModelRenderer(this, 45, 0);
            this.wolfHead.mirror = true;
            this.wolfHead.addBox(-4F, -2.133333F, -2F, 5, 5, 4);
            this.wolfHead.setRotationPoint(0F, 15.5F, -7F);
            this.wolfHead.setTextureSize(64, 32);
            setRotation(this.wolfHead, 0F, 0.0349066F, 0F);
      
            this.body = new ModelRenderer(this, 46, 17);
            this.body.mirror = true;
            this.body.addBox(-4F, -8F, -4F, 5, 11, 4);
            this.body.setRotationPoint(0F, 15F, 2F);
            this.body.setTextureSize(64, 32);
            setRotation(this.body, 1.570796F, 0F, 0F);
      
            this.leg1 = new ModelRenderer(this, 24, 24);
            this.leg1.mirror = true;
            this.leg1.addBox(0F, 1F, -1F, 2, 6, 2);
            this.leg1.setRotationPoint(-3.5F, 17F, 4F);
            this.leg1.setTextureSize(64, 32);
            setRotation(this.leg1, 0F, 0F, 0F);
      
            this.leg2 = new ModelRenderer(this, 4, 14);
            this.leg2.mirror = true;
            this.leg2.addBox(-2F, 1F, -1F, 2, 6, 2);
            this.leg2.setRotationPoint(0.5F, 17F, 4F);
            this.leg2.setTextureSize(64, 32);
            setRotation(this.leg2, 0F, 0F, 0F);
      
            this.leg3 = new ModelRenderer(this, 14, 24);
            this.leg3.mirror = true;
            this.leg3.addBox(-1F, 1F, -1F, 2, 6, 2);
            this.leg3.setRotationPoint(-2.5F, 17F, -4F);
            this.leg3.setTextureSize(64, 32);
            setRotation(this.leg3, 0F, 0F, 0F);
      
            this.leg4 = new ModelRenderer(this, 4, 24);
            this.leg4.mirror = true;
            this.leg4.addBox(-2F, 1F, -1F, 2, 6, 2);
            this.leg4.setRotationPoint(0.5F, 17F, -4F);
            this.leg4.setTextureSize(64, 32);
            setRotation(this.leg4, 0F, 0F, 0F);
      
            this.tail = new ModelRenderer(this, 34, 24);
            this.tail.mirror = true;
            this.tail.addBox(-2F, 0F, -2F, 3, 6, 2);
            this.tail.setRotationPoint(-1F, 15F, 4F);
            this.tail.setTextureSize(64, 32);
            setRotation(this.tail, 1.130069F, 0F, -0.0174533F);
      
            this.ear1 = new ModelRenderer(this, 16, 14);
            this.ear1.mirror = true;
            this.ear1.addBox(-3F, -3F, 0F, 2, 3, 1);
            this.ear1.setRotationPoint(-1F, 13.5F, -7F);
            this.ear1.setTextureSize(64, 32);
            setRotation(this.ear1, 0F, 0F, 0F);
      
            this.ear2 = new ModelRenderer(this, 25, 14);
            this.ear2.mirror = true;
            this.ear2.addBox(0F, -3F, 0F, 2, 3, 1);
            this.ear2.setRotationPoint(-1F, 13.5F, -7F);
            this.ear2.setTextureSize(64, 32);
            setRotation(this.ear2, 0F, 0F, 0F);
      
            this.shape1 = new ModelRenderer(this, 32, 1);
            this.shape1.mirror = true;
            this.shape1.addBox(-1F, -0.8666667F, -3F, 3, 2, 3);
            this.shape1.setRotationPoint(-2F, 17F, -8F);
            this.shape1.setTextureSize(64, 32);
            setRotation(this.shape1, 0F, 0.0523599F, 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);
          this.wolfHead.render(f5);
          this.body.render(f5);
          this.leg1.render(f5);
          this.leg2.render(f5);
          this.leg3.render(f5);
          this.leg4.render(f5);
          this.tail.render(f5);
          this.ear1.render(f5);
          this.ear2.render(f5);
          this.shape1.render(f5);
        }
      
        public static void setRotation(ModelRenderer model, float x, float y, float z)
        {
          model.rotateAngleX = x;
          model.rotateAngleY = y;
          model.rotateAngleZ = z;
        }
      
      public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity){
      
       //Head Movement:
       this.wolfHead.rotateAngleY = par4 / (180F / (float)Math.PI);
       this.wolfHead.rotateAngleX = par5 / (180F / (float)Math.PI);
       //
       this.ear1.rotateAngleY = par4 / (180F / (float)Math.PI);
       this.ear1.rotateAngleX = par5 / (180F / (float)Math.PI);
       this.ear2.rotateAngleY = par4 / (180F / (float)Math.PI);
       this.ear2.rotateAngleX = par5 / (180F / (float)Math.PI);
      //shape1 = museau
       this.shape1.setRotationPoint(-2F, 17F, -8F);
       this.shape1.rotateAngleX = this.wolfHead.rotateAngleX;
       this.shape1.rotateAngleY = this.wolfHead.rotateAngleY;
       //Head Movement END//
      
       //Rightarm Movement:
       this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F;
       this.leg1.rotateAngleZ = 0.0F;
       //Rightarm Movement END//
      
       //Leftarm Movement:
       this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;
       this.leg2.rotateAngleZ = 0.0F;
       //Leftarm Movement END//
      
       //Rightleg Movement:
       this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
       this.leg3.rotateAngleZ = 0.0F;
       //Rightleg Movement END//
      
       //LeftLeg Movement:
       this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
       //LeftLeg Movement END//
      
       //tail = queue
       //body = corp
      
      }
      }
      

      en espérant avoir été clair.

      Cordialement Florian.

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

        Si tu fais le modèle avec techne la boule bleu est bien orienté au centre du museau à l’extrémité ? ( vers la tête )

        Oui ce gif est drôle.

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

          C’est déjà 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

            Le centre de rotation du museau doit être au même endroit que celui de la tête et non sur la tête.

            1 réponse Dernière réponse Répondre Citer 0
            • elias54E Hors-ligne
              elias54 Administrateurs
              dernière édition par

              Pour les models complèxes de ce genre il faut souvent faire appel au tête.addChild(TonMuseau)

              Mon site | GitHub

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

                C’est pas bien compliqué (pour moi en tout cas) envoie le model techne et j’te corrige le tout ok ?

                Si je t'ai filé un coup de main n'oublie pas le + / -
                Par contre évite les demandes d'aides en MP, tu sera sympa'

                La JavaDoc c'est comme le PQ, ça sert à ce démerder tous seul. -Victor Hugo- 2017

                Une superbe API pour animer vos super modèles CraftStudio dans Minecraft !

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

                  Mon modèle en pièce jointe :)___C’est bon! problème résolu! en gros j’ai mis la boule de rotation du nez pareil que celle de la tête et c’est bon par contre j’ai un autre problème un second museau apparaît mais bien plus bas dans le sol du coup quand il saute on le vois ^^

                  PS: J’ai bien regardé sur mon modèle techne, cela vient pas de la .

                  screen: http://puu.sh/kMczi/ddd9ca1a3e.png

                  CODE:

                  package com.ArmaGames.net;
                  
                  import net.minecraft.client.model.ModelBase;
                  import net.minecraft.client.model.ModelRenderer;
                  import net.minecraft.entity.Entity;
                  import net.minecraft.util.MathHelper;
                  
                  public class Fox extends ModelBase
                  {
                      public ModelRenderer wolfHead;
                      public ModelRenderer body;
                      public ModelRenderer leg1;
                      public ModelRenderer leg2;
                      public ModelRenderer leg3;
                      public ModelRenderer leg4;
                      public ModelRenderer tail;
                      public ModelRenderer ear1;
                      public ModelRenderer ear2;
                      public ModelRenderer shape1;
                  
                    public Fox()
                    {
                        this.textureWidth = 64;
                        this.textureHeight = 32;
                  
                        this.wolfHead = new ModelRenderer(this, 45, 0);
                        this.wolfHead.mirror = true;
                        this.wolfHead.addBox(-3F, -3.133333F, -1F, 5, 5, 4);
                        this.wolfHead.setRotationPoint(-1F, 16.5F, -8F);
                        this.wolfHead.setTextureSize(64, 32);
                        setRotation(this.wolfHead, 0F, 0.0349066F, 0F);
                  
                        this.body = new ModelRenderer(this, 46, 17);
                        this.body.mirror = true;
                        this.body.addBox(-4F, -8F, -4F, 5, 11, 4);
                        this.body.setRotationPoint(0F, 15F, 2F);
                        this.body.setTextureSize(64, 32);
                        setRotation(this.body, 1.570796F, 0F, 0F);
                  
                        this.leg1 = new ModelRenderer(this, 24, 24);
                        this.leg1.mirror = true;
                        this.leg1.addBox(0F, 1F, -1F, 2, 6, 2);
                        this.leg1.setRotationPoint(-3.5F, 17F, 4F);
                        this.leg1.setTextureSize(64, 32);
                        setRotation(this.leg1, 0F, 0F, 0F);
                  
                        this.leg2 = new ModelRenderer(this, 4, 14);
                        this.leg2.mirror = true;
                        this.leg2.addBox(-2F, 1F, -1F, 2, 6, 2);
                        this.leg2.setRotationPoint(0.5F, 17F, 4F);
                        this.leg2.setTextureSize(64, 32);
                        setRotation(this.leg2, 0F, 0F, 0F);
                  
                        this.leg3 = new ModelRenderer(this, 14, 24);
                        this.leg3.mirror = true;
                        this.leg3.addBox(-1F, 1F, -1F, 2, 6, 2);
                        this.leg3.setRotationPoint(-2.5F, 17F, -4F);
                        this.leg3.setTextureSize(64, 32);
                        setRotation(this.leg3, 0F, 0F, 0F);
                  
                        this.leg4 = new ModelRenderer(this, 4, 24);
                        this.leg4.mirror = true;
                        this.leg4.addBox(-2F, 1F, -1F, 2, 6, 2);
                        this.leg4.setRotationPoint(0.5F, 17F, -4F);
                        this.leg4.setTextureSize(64, 32);
                        setRotation(this.leg4, 0F, 0F, 0F);
                  
                        this.tail = new ModelRenderer(this, 34, 24);
                        this.tail.mirror = true;
                        this.tail.addBox(-2F, 0F, -2F, 3, 6, 2);
                        this.tail.setRotationPoint(-1F, 15F, 4F);
                        this.tail.setTextureSize(64, 32);
                        setRotation(this.tail, 1.130069F, 0F, -0.0174533F);
                  
                        this.ear1 = new ModelRenderer(this, 16, 14);
                        this.ear1.mirror = true;
                        this.ear1.addBox(-3F, -3F, 0F, 2, 3, 1);
                        this.ear1.setRotationPoint(-1F, 13.5F, -7F);
                        this.ear1.setTextureSize(64, 32);
                        setRotation(this.ear1, 0F, 0F, 0F);
                  
                        this.ear2 = new ModelRenderer(this, 25, 14);
                        this.ear2.mirror = true;
                        this.ear2.addBox(0F, -3F, 0F, 2, 3, 1);
                        this.ear2.setRotationPoint(-1F, 13.5F, -7F);
                        this.ear2.setTextureSize(64, 32);
                        setRotation(this.ear2, 0F, 0F, 0F);
                  
                        this.shape1 = new ModelRenderer(this, 32, 1);
                        this.shape1.mirror = true;
                        this.shape1.addBox(-2F, 1.133333F, -3F, 3, 2, 3);
                        this.shape1.setRotationPoint(-1F, 15F, -8F);
                        this.shape1.setTextureSize(64, 32);
                        setRotation(this.shape1, 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);
                      this.wolfHead.render(f5);
                      this.body.render(f5);
                      this.leg1.render(f5);
                      this.leg2.render(f5);
                      this.leg3.render(f5);
                      this.leg4.render(f5);
                      this.tail.render(f5);
                      this.ear1.render(f5);
                      this.ear2.render(f5);
                      this.shape1.render(f5);
                  
                      wolfHead.addChild(shape1);
                    }
                  
                    public static void setRotation(ModelRenderer model, float x, float y, float z)
                    {
                      model.rotateAngleX = x;
                      model.rotateAngleY = y;
                      model.rotateAngleZ = z;
                    }
                  
                  public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity){
                  
                   //Head Movement:
                   this.wolfHead.rotateAngleY = par4 / (180F / (float)Math.PI);
                   this.wolfHead.rotateAngleX = par5 / (180F / (float)Math.PI);
                   //
                   this.ear1.rotateAngleY = par4 / (180F / (float)Math.PI);
                   this.ear1.rotateAngleX = par5 / (180F / (float)Math.PI);
                   this.ear2.rotateAngleY = par4 / (180F / (float)Math.PI);
                   this.ear2.rotateAngleX = par5 / (180F / (float)Math.PI);
                  
                        this.shape1.rotateAngleX = this.wolfHead.rotateAngleX;
                        this.shape1.rotateAngleY = this.wolfHead.rotateAngleY;
                   //Head Movement END//
                  
                   //Rightarm Movement:
                   this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F;
                   this.leg1.rotateAngleZ = 0.0F;
                   //Rightarm Movement END//
                  
                   //Leftarm Movement:
                   this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;
                   this.leg2.rotateAngleZ = 0.0F;
                   //Leftarm Movement END//
                  
                   //Rightleg Movement:
                   this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
                   this.leg3.rotateAngleZ = 0.0F;
                   //Rightleg Movement END//
                  
                   //LeftLeg Movement:
                   this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
                   //LeftLeg Movement END//
                  
                   //tail = queue
                   //body = corp
                  
                  }
                  }
                  
                  ```___Ok c'est bon! c'était le: "wolfHead.addChild(shape1);"
                  
                  Merci de votre aide!
                  1 réponse Dernière réponse Répondre Citer 0
                  • DiabolicaTrixD Hors-ligne
                    DiabolicaTrix Correcteurs Moddeurs confirmés
                    dernière édition par

                    Triple post…

                    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

                      SuperAdmin4002 s’est occupé de tout fusionner 😉

                      1 réponse Dernière réponse Répondre Citer 0
                      • elias54E Hors-ligne
                        elias54 Administrateurs
                        dernière édition par

                        Robin, toujours au top de l’humour !

                        Mon site | GitHub

                        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