예제 #1
0
        void scaling(out double x, out double y)
        {
            double      x1 = 0.0;
            double      y1 = 0.0;
            double      x2 = 1.0;
            double      y2 = 1.0;
            Perspective t  = new Perspective(this);

            t *= Affine.NewRotation(-rotation());
            t.Transform(ref x1, ref y1);
            t.Transform(ref x2, ref y2);
            x = x2 - x1;
            y = y2 - y1;
        }
예제 #2
0
        // Inverse transformation of x and y. It works slow because
        // it explicitly inverts the matrix on every call. For massive
        // operations it's better to invert() the matrix and then use
        // direct transformations.
        void inverse_transform(ref double x, ref double y)
        {
            Perspective t = new Perspective(this);

            if (t.invert())
            {
                t.Transform(ref x, ref y);
            }
        }
예제 #3
0
        public static VertexStore TransformToVxs(this Perspective perspecitveTx, VertexStoreSnap snap, VertexStore vxs)
        {
            var       vsnapIter = snap.GetVertexSnapIter();
            double    x, y;
            VertexCmd cmd;

            do
            {
                cmd = vsnapIter.GetNextVertex(out x, out y);
                perspecitveTx.Transform(ref x, ref y);
                vxs.AddVertex(x, y, cmd);
            } while (!VertexHelper.IsEmpty(cmd));
            return(vxs);
        }
예제 #4
0
        public static VertexStore TransformToVxs(this Perspective perspecitveTx, VertexStore src, VertexStore vxs)
        {
            VertexCmd cmd;
            double    x, y;
            int       count = src.Count;

            for (int i = 0; i < count; ++i)
            {
                cmd = src.GetVertex(i, out x, out y);
                perspecitveTx.Transform(ref x, ref y);
                vxs.AddVertex(x, y, cmd);
            }
            return(vxs);
        }