Bonjour j'essaie d'animer un bones du personnage "dude" fournit dans les exemples de XNA.

Je copie soigneusement le code mais rien n'y fait cela ne marche pas xD!!

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
 
//declaration
 
        ModelBone leftThigh;
        Matrix leftThighTransform;
        public Matrix matRot = Matrix.Identity;
 
//affectation
 
            this.leftThigh = model.Bones["L_UpperArm"];
            this.leftThighTransform = leftThigh.Transform;
 
//draw
 
        public override void Draw(GameTime gameTime)
        {
            //Notice that the entity's worldTransform property is being accessed here.
            //This property is returns a rigid transformation representing the orientation
            //and translation of the entity combined.
            //There are a variety of properties available in the entity, try looking around
            //in the list to familiarize yourself with it.
 
            leftThigh.Transform = matRot * leftThighTransform;
            Matrix[] boneTransforms = new Matrix[model.Bones.Count];
            model.CopyAbsoluteBoneTransformsTo(boneTransforms);
 
            worldMatrix = transform * entity.worldTransform;
 
            model.CopyAbsoluteBoneTransformsTo(boneTransforms);
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.World = boneTransforms[mesh.ParentBone.Index] * worldMatrix;
                    effect.View = (Game as RunMan).user.camera.ViewMatrix;
                    effect.Projection = (Game as RunMan).user.camera.projectionMatrix;
                }
                mesh.Draw();
            }
            base.Draw(gameTime);
        }
 
//changeable
 
            if (keyboardState.IsKeyDown(Keys.Up))
            {
                camera.MoveForward(dt);
                //game.entModelHero.entity.linearVelocity = Vector3.Forward * 5;
                game.entModelHero.matRot += Matrix.CreateRotationZ(0.3f);
            }
Si quelqu'un à une idée , je suis preneur !

Merci & bonnes fêtes!