> > The problem is most people don't want a linear warp, they want a psuedo > > perspective warp, which involves warping four points and trapeziods > > rather than triangles. > > > You can't do that directly with a -affine matrix. > > Every quad is simply two tris. Any quad can be warped as tris by > warping the tri of the first three points, and then warping the tri of > the last three points.
Actually, that's not the problem. The problem is that you are doing 3D transforms, whereas affine transforms are strictly 2D. For example, let's say you have a triangle you are transforming so that the height is taller but the base stays the same. With an affine transform, the height of each pixel is scaled the same amount. What you probably need is for the scale factor of each pixel to be based on its distance from the base. Let's say the top of the triangle recedes into the distance. In that case the top pixels would be scaled so they're shorter than the bottom pixels. An affine transform cannot do this, but a perspective transform can. Of course you could always use enough triangles to approximate a perspective transform with affine transforms. In that case, I suggest looking at the xmorph program on sourceforge (xmorph.sourceforge.net). It does 2D warping, and you may be able to use IM to convert between your source format and TGA, then use morph/xmorph on the TGA files. GNS _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
