Exemple #1
0
        public Cube(int x, int y, int z)
        {
            Location = new Point3D(x, y, z);
            Faces    = new Face3D[6];
            int Y = Location.Y;
            int X = Location.X;
            int Z = Location.Z;

            Faces[0]        = new Face3D(new Point3D(X, Y, Z - 1), new Point3D(X + 1, Y, Z - 1), new Point3D(X + 1, Y, Z), Location);
            Faces[1]        = new Face3D(new Point3D(X + 1, Y, Z - 1), new Point3D(X, Y, Z - 1), new Point3D(X, Y - 1, Z - 1), new Point3D(X, Y - 1, Z - 1));
            Faces[2]        = new Face3D(new Point3D(X, Y, Z - 1), new Point3D(X, Y, Z), new Point3D(X, Y - 1, Z), new Point3D(X, Y - 1, Z - 1));
            Faces[3]        = new Face3D(new Point3D(X, Y, Z), new Point3D(X + 1, Y, Z), new Point3D(X + 1, Y - 1, Z), new Point3D(X, Y - 1, Z));
            Faces[4]        = new Face3D(new Point3D(X + 1, Y, Z), new Point3D(X + 1, Y, Z - 1), new Point3D(X + 1, Y - 1, Z - 1), new Point3D(X + 1, Y - 1, Z));
            Faces[5]        = new Face3D(new Point3D(X, Y - 1, Z), new Point3D(X + 1, Y, Z), new Point3D(X + 1, Y - 1, Z - 1), new Point3D(X, Y - 1, Z - 1));
            VisibleFaces    = new Face3D[3];
            VisibleFaces[0] = Faces[0];
            VisibleFaces[1] = Faces[2];
            VisibleFaces[2] = Faces[3];
        }
Exemple #2
0
        public Cube(Point3D location)
        {
            Location = location;
            Faces    = new Face3D[6];
            int Y = location.Y;
            int X = location.X;
            int Z = location.Z;

            Faces[0]        = new Face3D(new Point3D(X, Y, Z - 1), new Point3D(X + 1, Y, Z - 1), new Point3D(X + 1, Y, Z), location);
            Faces[1]        = new Face3D(new Point3D(X + 1, Y, Z - 1), new Point3D(X, Y, Z - 1), new Point3D(X, Y - 1, Z - 1), new Point3D(X, Y - 1, Z - 1));
            Faces[2]        = new Face3D(new Point3D(X, Y, Z - 1), new Point3D(X, Y, Z), new Point3D(X, Y - 1, Z), new Point3D(X, Y - 1, Z - 1));
            Faces[3]        = new Face3D(new Point3D(X, Y, Z), new Point3D(X + 1, Y, Z), new Point3D(X + 1, Y - 1, Z), new Point3D(X, Y - 1, Z));
            Faces[4]        = new Face3D(new Point3D(X + 1, Y, Z), new Point3D(X + 1, Y, Z - 1), new Point3D(X + 1, Y - 1, Z - 1), new Point3D(X + 1, Y - 1, Z));
            Faces[5]        = new Face3D(new Point3D(X, Y - 1, Z), new Point3D(X + 1, Y, Z), new Point3D(X + 1, Y - 1, Z - 1), new Point3D(X, Y - 1, Z - 1));
            VisibleFaces    = new Face3D[3];
            VisibleFaces[0] = Faces[0];
            VisibleFaces[1] = Faces[2];
            VisibleFaces[2] = Faces[3];
        }