Exemplo n.º 1
0
        public static void Test3()
        {
            var sand = SandTable.CreateSandTable(Size, Size, 15);

            SandTable.ClearHeightLimits(sand);
            SandTable.ApplyHeightLimitPattern(sand, HeightLimitPatternLibrary.SmallCube, new Point {
                X = 10, Y = 10, Height = 10
            });

            SandTable.SettleMapTwoPass(sand);
            Exporters.SandToImageExporter.SaveMatrixAsImage(sand, OutDir, "testK.png");
            Exporters.SandTo3dFileExporter.SaveSandAs3dFile(sand, OutDir, "testK.obj");
        }
Exemplo n.º 2
0
        public static void Test4()
        {
            var diameter      = 30;
            var sand          = SandTable.CreateSandTable(diameter, diameter, diameter / 2);
            var spherePattern = HeightLimitPatternLibrary.Sphere(diameter);

            SandTable.ApplyHeightLimitPattern(sand, spherePattern, new Point {
                X = 0, Y = 0, Height = diameter / 2
            });

            foreach (var sandColumn in sand)
            {
                sandColumn.Height = sandColumn.HeightLimit;
            }

            Exporters.SandToImageExporter.SaveMatrixAsImage(sand, OutDir, "testL.png");
            Exporters.SandTo3dFileExporter.SaveSandAs3dFile(sand, OutDir, "testL.obj");
        }
Exemplo n.º 3
0
        public static void Test2()
        {
            var sand = SandTable.CreateSandTable(Size, Size, 15);

            SandTable.ClearHeightLimits(sand);
            SandTable.ApplyHeightLimitPattern(sand, HeightLimitPatternLibrary.SmallCube, new Point {
                X = 10, Y = 10, Height = 10
            });

            //int iteration = 0;
            //SandToImageOutputter.SaveMatrixAsImage(sand, @"C:\Users\dgulyas\Desktop\out\testC", $"test{iteration++}.png");

            var iteration = 0;

            while (SandTable.SettleMapRandom(sand) && iteration++ < 5)
            {
                Console.WriteLine(iteration);
                //SandToImageOutputter.SaveMatrixAsImage(sand, @"C:\Users\dgulyas\Desktop\out\testC", $"test{iteration++}.png");
            }
            //PrintMapHeights(m_sand);
            Exporters.SandToImageExporter.SaveMatrixAsImage(sand, OutDir, "testG.png");
            Exporters.SandTo3dFileExporter.SaveSandAs3dFile(sand, OutDir, "testG.obj");
            //Console.ReadLine();
        }