I am drawing a textured trapezoid in OpenGL and affine problem occurs:
http://upload.wikimedia.org/wikipedia/commons/5/57/Perspective_correct_texture_mapping.jpg
I want my texture this in perspective-correct.
I have to interpolate in the image space (sw tw w) and I don't know how to do it:
http://i.stack.imgur.com/O0AnC.png
I paste my current code project:
- c++:
ttps://gist.github.com/danicomas/a1f5a0e6849b3ac8b51c169c2c030e37 (Add http)
- vertex:
ttps://gist.github.com/danicomas/fee77cf48fc5085f61a2fcf7a2c6d5de (Add http)
- fragment:
ttps://gist.github.com/danicomas/0bbd679d2d7da18bc61ee23b36096a16 (Add http)
How can I do this? Some example code?