コード例 #1
0
ファイル: Shape.cs プロジェクト: KamilNies/Laboration2App
        private static Cuboid GenerateCuboid(Vector3 center)
        {
            var cuboid = new Cuboid(center, new Vector3(rng.Next(1, 21), rng.Next(1, 21), rng.Next(1, 21)));

            while (cuboid.IsCube)
            {
                cuboid = new Cuboid(center, new Vector3(rng.Next(1, 21), rng.Next(1, 21), rng.Next(1, 21)));
            }
            return(cuboid);
        }
コード例 #2
0
ファイル: Shape.cs プロジェクト: KamilNies/Laboration2App
        private static Cuboid GenerateRandomCuboid()
        {
            var cuboid = new Cuboid(new Vector3(rng.Next(-100, 101), rng.Next(-100, 101), rng.Next(-100, 101)),
                                    new Vector3(rng.Next(1, 21), rng.Next(1, 21), rng.Next(1, 21)));

            while (cuboid.IsCube)
            {
                cuboid = new Cuboid(new Vector3(rng.Next(-100, 101), rng.Next(-100, 101), rng.Next(-100, 101)),
                                    new Vector3(rng.Next(1, 21), rng.Next(1, 21), rng.Next(1, 21)));
            }
            return(cuboid);
        }