PDA

View Full Version : trapezoid mapping



elezaza
07-02-2007, 08:52 AM
I need to map a texture on a 2D quad... so I have a bad texturing .... when it's not a square. I have find the projection matrix that transform the standard square in the quad... and It seems that if I load the matrix for the texture, the mapping should be perspective corrected ?
glMatrixMode(GL_TEXTURE);
glLoadMatrixf(matrix);
glMatrixMode(GL_MODELVIEW);

matrix is the projection matrix that map for example a standard square (for exemple : X1(0,0) X2(100,0) X3(100,100) X4(0,100) to a quad Y1(10,-5) Y2(45,20) Y3 (101,5) Y4(8,90)

the result seems not too far but it's not exact for sure...
Best regards,
Yannick

Jackis
07-03-2007, 02:59 PM
Try this tutorial:
http://www.r3.nu/~cass/qcoord/

Here is general method:
ftp://ftp.cs.unc.edu/pub/publications/techreports/02-024.pdf

knackered
07-03-2007, 04:58 PM
there's a lot of people trying to do this at the moment isn't there?
Or is this the same guy as last time?