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


C# Mesh.Draw方法代码示例

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


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

示例1: DrawBatch

 private void DrawBatch(Mesh mesh)
 {
   (mesh.Effect as InstancedBlackHoleEffect).SetInstanceData(this.InstanceData);
   mesh.Draw();
 }
开发者ID:Zeludon,项目名称:FEZ,代码行数:5,代码来源:BlackHolesHost.cs

示例2: ClearDepth

 private void ClearDepth(Mesh mesh)
 {
   bool depthWrites = mesh.DepthWrites;
   ColorWriteChannels colorWriteChannels = GraphicsDeviceExtensions.GetBlendCombiner(this.GraphicsDevice).ColorWriteChannels;
   mesh.DepthWrites = true;
   GraphicsDeviceExtensions.SetColorWriteChannels(this.GraphicsDevice, ColorWriteChannels.None);
   mesh.AlwaysOnTop = true;
   mesh.Position += this.CameraManager.InverseView.Forward * 2f;
   mesh.Draw();
   mesh.AlwaysOnTop = false;
   mesh.Position -= this.CameraManager.InverseView.Forward * 2f;
   GraphicsDeviceExtensions.SetColorWriteChannels(this.GraphicsDevice, colorWriteChannels);
   mesh.DepthWrites = depthWrites;
 }
开发者ID:tanis2000,项目名称:FEZ,代码行数:14,代码来源:SplitUpCubeHost.cs

示例3: Main


//.........这里部分代码省略.........

            window.AddPostProcessingEffect(new BlackBands());

            window.AddPostProcessingEffect(new RedBands());

            // insert a postprocessing effect at the specific position
            window.SetPostProcessingEffect(1, new WASDEffect());

            window.SetPostProcessingEffect(1, new WobbleEffect(5));

            Tilemap tileMap = new Tilemap("Assets/map001.csv", "Assets/tiles_spritesheet.png");

            while (window.opened)
            {
                if (window.GetKey(KeyCode.Right))
                {
                    tileMap.position += new Vector2(1, 0) * window.deltaTime * 300;
                }
                if (window.GetKey(KeyCode.Left))
                {
                    tileMap.position += new Vector2(-1, 0) * window.deltaTime * 300;
                }
                if (window.GetKey(KeyCode.Up))
                {
                    tileMap.position += new Vector2(0, -1) * window.deltaTime * 300;
                }
                if (window.GetKey(KeyCode.Down))
                {
                    tileMap.position += new Vector2(0, 1) * window.deltaTime * 300;
                }

                tileMap.position += window.JoystickAxisRight(0) * window.deltaTime * 300;

                tileMap.Draw();

                for (int i = 0; i < tiles2.Instances; i++)
                {
                    tiles2.SetPosition(i, new Vector2(20 * i, 20 * i), true);
                    if (i % 2 == 0)
                    {
                        tiles2.SetAdditiveColor(i, new Vector4(1, -1, -1, 1), true);
                    }
                }
                tiles2.UpdatePositions();
                tiles2.UpdateAdditiveColors();

                ship.position.Y = 10;
                ship.position += new Vector2(5f, 0) * window.deltaTime;

                ship.scale = new Vector2(1f, 1f);

                t += window.deltaTime;
                if (t > 1f / 24f)
                {
                    index++;
                    if (index >= 51)
                        index = 0;
                    t = 0;
                }
                int x = (index % 10) * (alien.Width / 10);
                int y = (index / 10) * height;

                ship.DrawTexture(alien, x, y, alien.Width / 10, height);

                square.DrawSolidColor(1f, 0, 0, 0.5f);
开发者ID:aiv01,项目名称:aiv-fast2d,代码行数:66,代码来源:Program.cs


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