当前位置: 首页>>代码示例>>C#>>正文


C# Model.CopyBoneTransformsFrom方法代码示例

本文整理汇总了C#中Microsoft.Xna.Framework.Graphics.Model.CopyBoneTransformsFrom方法的典型用法代码示例。如果您正苦于以下问题:C# Model.CopyBoneTransformsFrom方法的具体用法?C# Model.CopyBoneTransformsFrom怎么用?C# Model.CopyBoneTransformsFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Xna.Framework.Graphics.Model的用法示例。


在下文中一共展示了Model.CopyBoneTransformsFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawModel

        protected override void DrawModel(GraphicsDeviceManager graphics, Model model, Matrix world)
        {
            #region RotateSpine
            int spineBone = model.Bones["Bip01 Spine1"].Index;
            boneTransforms[spineBone] = Matrix.CreateRotationZ(spineElevation) * Matrix.CreateRotationX(spineAzimuth) * boneTransforms[spineBone];
            model.CopyBoneTransformsFrom(boneTransforms);
            model.CopyAbsoluteBoneTransformsTo(absoTransforms);
            #endregion

            base.DrawModel(graphics, model, world);
        }
开发者ID:ksuh90,项目名称:P3,代码行数:11,代码来源:Victoria.cs

示例2: DrawModel

        private void DrawModel(GraphicsDeviceManager graphics, Model model, Matrix world)
        {
            // Apply the bone transforms
            Matrix[] absoTransforms = new Matrix[model.Bones.Count];
            model.CopyBoneTransformsFrom(boneTransforms);
            model.CopyAbsoluteBoneTransformsTo(absoTransforms);

            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (Effect effect in mesh.Effects)
                {
                    effect.Parameters["World"].SetValue(absoTransforms[mesh.ParentBone.Index] * world);
                    effect.Parameters["View"].SetValue(game.Camera.View);
                    effect.Parameters["Projection"].SetValue(game.Camera.Projection);
                    effect.Parameters["yValue"].SetValue(1-2*sliming);
                }
                mesh.Draw();
            }
        }
开发者ID:Cheaneyc,项目名称:473-project3,代码行数:19,代码来源:PrisonModel.cs

示例3: DrawModel

        private void DrawModel(GraphicsDeviceManager graphics, Model model, Matrix world)
        {
            // Apply the bone transforms
            Matrix[] absoTransforms = new Matrix[model.Bones.Count];
            model.CopyBoneTransformsFrom(boneTransforms);
            model.CopyAbsoluteBoneTransformsTo(absoTransforms);

            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (Effect effect in mesh.Effects)
                {
                    effect.Parameters["World"].SetValue(absoTransforms[mesh.ParentBone.Index] * world);
                    effect.Parameters["View"].SetValue(game.Camera.View);
                    effect.Parameters["Projection"].SetValue(game.Camera.Projection);
                    effect.Parameters["Time"].SetValue((float)game.SlimeTime);

                    // The section the open door is in. (-1 for no open door)
                    int sectionOfOpenDoor = -1;

                    // The door that is open (null for no open door)
                    Door openDoor = GetOpenDoor(section);

                    // If the door is open, get the sectionOfOpenDoor
                    if (openDoor != null)
                    {
                        sectionOfOpenDoor = openDoor.GetSectionNumber();
                    }

                    //If there is an open door, set the openness.
                    if (sectionOfOpenDoor != -1)
                    {
                        // How open the door is (0 for no open door)
                        float opennessOfDoor = GetOpenDoorDegree(openDoor);
                        if (opennessOfDoor < 0) opennessOfDoor = 0;
                        if (opennessOfDoor > 1) opennessOfDoor = 1;

                        //If there is a slightly open door, set the color (turn it on) and set the location.
                        effect.Parameters["Light4Location"].SetValue(LightInfo(sectionOfOpenDoor, 6));
                        effect.Parameters["OpennessOfDoor"].SetValue(opennessOfDoor);
                    }
                    else
                    {
                        effect.Parameters["OpennessOfDoor"].SetValue(0);
                    }
                }

                mesh.Draw();
            }
        }
开发者ID:ksuh90,项目名称:P3,代码行数:49,代码来源:PrisonModel.cs


注:本文中的Microsoft.Xna.Framework.Graphics.Model.CopyBoneTransformsFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。