示例#1
0
        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
        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);
        }