當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。