Ejemplo n.º 1
0
        public static void TestRenderBones()
        {
            TestXNAGame main = null;


            SkinnedModel model = null;
            ColladaModel col   = null;

            TestXNAGame.Start("TestShowBones",
                              delegate
            {
                main = TestXNAGame.Instance;


                //col = ColladaModel.FromFile( new GameFile( main.RootDirectory + "/Content/Goblin.DAE" ) );
                //col = ColladaModel.LoadSimpleCharacterAnim001();
                col = ColladaModel.LoadSimpleBones001();

                model = SkinnedModelBuilder.LoadSkinnedModel(main, col);
                //model.WorldMatrix = Matrix.CreateFromYawPitchRoll( -MathHelper.PiOver2, -MathHelper.PiOver2, 0 );
            },
                              delegate
            {
                model.UpdateAnimation(main.Elapsed);
                model.RenderBonesLines();
            });
        }
Ejemplo n.º 2
0
        public static void TestRenderAnimated()
        {
            TestXNAGame  main  = null;
            SkinnedModel model = null;

            ColladaModel col = null;


            TestXNAGame.Start("TestRenderAnimated",
                              delegate
            {
                main = TestXNAGame.Instance;

                //col = ColladaModel.FromFile( new GameFile( main.RootDirectory + "/Content/Goblin.DAE" ) );
                //col = ColladaModel.FromFile( new GameFile( main.RootDirectory + "/DebugFiles/VerySimpleBones001(disabled).DAE" ) );
                //col = ColladaModel.FromFile( new GameFile( main.RootDirectory + "/Content/TriangleBones002.DAE" ) );
                col = ColladaModel.LoadSimpleCharacterAnim001();
                //col = ColladaModel.LoadSimpleBones001();
                //col = ColladaModel.LoadTriangleBones001();

                model             = SkinnedModelBuilder.LoadSkinnedModel(main, col);
                model.WorldMatrix = Matrix.CreateFromYawPitchRoll(-MathHelper.PiOver2, -MathHelper.PiOver2, 0);
                //model.WorldMatrix = Matrix.Identity;
            },
                              delegate
            {
                main.GraphicsDevice.RenderState.CullMode = CullMode.None;
                if (main.Keyboard.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.R))
                {
                    model             = SkinnedModelBuilder.LoadSkinnedModel(main, col);
                    model.WorldMatrix = Matrix.Identity;    // Matrix.CreateFromYawPitchRoll( -MathHelper.PiOver2, -MathHelper.PiOver2, 0 );
                }
                model.UpdateAnimation(main.Elapsed);
                model.Render();
                model.RenderBonesLines();
            });
        }