public void Usage()
        {
            Rect3D rect = new Rect3D();

            rect.GetCenter();
            rect.Scale(1.1);
        }
Example #2
0
        public static Rect3D Transform(this Matrix3D matrix, Rect3D bounds)
        {
            Point3D center = bounds.GetCenter();
            Point3D corner = new Point3D(
                bounds.Location.X + bounds.SizeX,
                bounds.Location.Y + bounds.SizeY,
                bounds.Location.Z + bounds.SizeZ);

            Point3D transformedCenter   = matrix.Transform(center);
            Point3D transformedLocation = matrix.Transform(bounds.Location);
            Point3D transformedCorner   = matrix.Transform(corner);

            Size3D transformedSize = new Size3D(
                Abs(transformedCenter.X - transformedLocation.X) * 2.0,
                Abs(transformedCenter.Y - transformedLocation.Y) * 2.0,
                Abs(transformedCenter.Z - transformedLocation.Z) * 2.0);

            transformedLocation = new Point3D(
                transformedCenter.X - (transformedSize.X / 2.0),
                transformedCenter.Y - (transformedSize.Y / 2.0),
                transformedCenter.Z - (transformedSize.Z / 2.0));
            return(new Rect3D(transformedLocation, transformedSize));
        }