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


C# Mesh.UpdateVertex方法代码示例

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


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

示例1: GameSetup

        private void GameSetup(Window window)
        {
            window.SetClearColor(0f, 1f, 1f);
            mesh001 = new Mesh();
            mesh001.v = new float[]
            {
                100, 100,
                50, 200,
                150, 200
            };
            mesh001.UpdateVertex();

            alienTexture = new Texture("Assets/2.png");
            alien = new Sprite(alienTexture.Width, alienTexture.Height);

            window.AddPostProcessingEffect(new GrayscaleEffect());
        }
开发者ID:aiv01,项目名称:aiv-fast2d,代码行数:17,代码来源:MainActivity.cs

示例2: Main

        static void Main(string[] args)
        {
            Window window = new Window(800, 600, "Aiv.Fast2D.Example");
            window.SetLogger(new ExampleLogger());
            window.SetIcon("aiv_fast2d_example.Assets.2.ico");

            window.SetCursor(false);

            Texture logoAiv = new Texture("aiv_fast2d_example.Assets.LogoAIV.png");

            Texture alien = new Texture("aiv_fast2d_example.Assets.owl.png");

            Sprite logo = new Sprite(logoAiv.Width, logoAiv.Height);

            int height = 150;

            Sprite ship = new Sprite(alien.Width / 10, height);

            Sprite ship2 = new Sprite(alien.Width / 10, height);

            Sprite square = new Sprite(100, 100);

            InstancedSprite tiles = new InstancedSprite(100, 100, 3);
            tiles.SetPosition(0, new Vector2(150, 100));
            tiles.SetPosition(1, new Vector2(200, 200));
            tiles.SetPosition(2, new Vector2(500, 500));

            tiles.SetScale(0, new Vector2(0.5f, 0.5f));
            tiles.SetScale(1, new Vector2(1.5f, 1.5f));

            InstancedSprite tiles2 = new InstancedSprite(20, 20, 30);

            RenderTexture screen = new RenderTexture(800, 600);

            RenderTexture fake = new RenderTexture(1, 1);
            fake.Dispose();

            Sprite monitor = new Sprite(100, 100);
            monitor.position = new Vector2(400, 200);

            int index = 0;
            float t = 0;

            window.SetClearColor(100, 100, 100);

            int counter = 0;

            ParticleSystem particleSystem = new ParticleSystem(2, 2, 100);
            particleSystem.position = new Vector2(400, 200);

            Rope rope = new Rope(400, 3);
            rope.position = new Vector2(400, 200);
            rope.SetDestination(new Vector2(400, 400));

            ship2.pivot = new Vector2(alien.Width / 20, height / 2);

            ParticleSystem particleSystem2 = new ParticleSystem(1, 2, 50);

            Mesh triangle = new Mesh();
            triangle.v = new float[] { 100, 100, 50, 200, 150, 200 };
            triangle.UpdateVertex();
            triangle.uv = new float[] { 0.5f, 0.5f, 0, 0, 1, 0 };
            triangle.UpdateUV();

            Mesh farTriangles = new Mesh();
            farTriangles.v = new float[]
            {
                300, 100,
                200, 200,
                400, 200,

                400, 400,
                300, 500,
                500, 500
            };
            farTriangles.UpdateVertex();

            Mesh colouredTriangle = new Mesh();
            colouredTriangle.v = new float[]
            {
                500, 200,
                400, 300,
                600, 300
            };
            colouredTriangle.UpdateVertex();

            colouredTriangle.vc = new float[]
            {
                1, 0, 0, 0.5f,
                0, 1, 0, 0.5f,
                0, 0, 1, 0.5f
            };
            colouredTriangle.UpdateVertexColor();

            Texture alien2 = new Texture("aiv_fast2d_example.Assets.2.png");
            RenderTexture maskedAlien = new RenderTexture(alien2.Width, alien2.Height);
            Sprite spriteMask = new Sprite(50, 50);

            Texture circleMask = new Texture("aiv_fast2d_example.Assets.mask_circle.png");
            Texture circleMask2 = new Texture("aiv_fast2d_example.Assets.mask_circle2.png");
//.........这里部分代码省略.........
开发者ID:aiv01,项目名称:aiv-fast2d,代码行数:101,代码来源:Program.cs


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