Dodger on  wrote...
| Oh, sorry if what I said was confusing. I'm using this to convert
| *textures* for 3D models, not to render the 3d models.
| 
Yes byt the texture generator in povray it is fantastic even if you are
only wanting a 2-D texture.  This is even talked about in the PovRay
manual.  This was my point.

| Thus I want to be able to take a texture designed for the latter, bad
| mapping of the figure and translate it to fit on the former good
| mapping. Each square would be repositioned, scaled, rotated as
| necessary, and the trapezoid would be undistorted. Of course, rather
| than thinking of them as squares, however, I'd be thinking of each
| square/trapezoid as a pair of triangles. For square, ABCD, I'd think
| in term of triangles ABC and BCD. But the warping owuld only take
| place in 2D, not 3D.
| 
| Thanks fcor the link to xmorph. I'll look closely at that as soon as I
| get where I'm going and back online.
| 

I understand what you are saying. However warping or unwarping a square
is definateally not the same as a triangle.

Warping one triangle to another triagle in 2-D space is a linear
operation, that IM can handle with a affine matrix.

However warping a square many not be linear.  When 4 points are involved
the warping becomes trpaziolidal, or a perspective transform. That is
the X and Y axis may be scaled differently depending on the other axis.

In other words you could have one scaling of the figure at one position
and a slightly different scale at another position.

Without such a perspecitive transform, four points may not map to four
other points.

For a proposal for a 'simple' and future 'perspetive matrix' transform
additions to IM  'furture proposals'.
   http://www.cit.gu.edu.au/~anthony/graphics/imagick6/bugs/future/#trapezoid


| > > 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.

Put it that way yes. a quad is just two triangles.  In fact two
differnet sets of triangles (in most cases).

The problem with that is that it is not a smooth transsition between the
two triangles.  You get a disjoint warp.  Sure you can smooth it out,
but that is getting very complex and messy compared to a trapeziodial
transform.

| > 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.
| >

The question now becomes, rather than generate a perspecitive/
trapediodal trensform for four points, we instead implement a general
triangular mesh transform, allowing use to then do warps of a picture
into perspetive, circular, curves, paper fold overs etc etc etc.

This of course would require some means of feeding a triangular mesh
patterns into IM, and providing some generators for such meshes as well.

  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
          Think of it as 'Evolution in Action'!     -- Larry Niven
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to