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

      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