Use Projection Space instead of 2d Affine Space to Texture

edited April 2014 in GLSL / Shaders

Hello everybody..!!

This is my first post here.. yeah!!

The question is the following:

I'm texturing a simple Quad with usual vertex(x,y,u,v). Everything's fine when the quad is rectangular, but when it starts becoming trapezoidal, the texture Coords go bad. Doing some research, I found out that, using affine 2D space, the texture being mapped the the inner triangles of the quad are interpreted in a way that produces that. To correct it, a Projection space needs to be used. This is where I got the info, and it is exactly whats happening: http://www.xyzw.us/~cass/qcoord/

You can see here that we need to provide 2 other coordinates for correction. These coordinates are not available in the vertex() method.

Any idea of how to deal with this? Maybe I'll have to do de calculations manually, which would be hard for me... ;)

I'm kinda new to the whole texture wrapping thing..!!

Thanx in advance for the help..!!

-- PleekMan www.pleek.net

Answers

  • Uppss..!!

    Sorry for the double post... didn't mean to... browser was weird..!!

Sign In or Register to comment.