【发布时间】:2013-10-08 21:00:30
【问题描述】:
我在 OpenGL 中绘制带纹理的梯形并出现仿射问题:
http://upload.wikimedia.org/wikipedia/commons/5/57/Perspective_correct_texture_mapping.jpg
我希望我的纹理透视正确。
我必须在图像空间(sw tw w)中插值,但我不知道该怎么做:
http://i.stack.imgur.com/O0AnC.png
我粘贴我当前的代码项目:
- c++:
ttps://gist.github.com/danicomas/a1f5a0e6849b3ac8b51c169c2c030e37(添加http)
- 顶点:
ttps://gist.github.com/danicomas/fee77cf48fc5085f61a2fcf7a2c6d5de(添加http)
- 片段:
ttps://gist.github.com/danicomas/0bbd679d2d7da18bc61ee23b36096a16(添加http)
我该怎么做?一些示例代码?
【问题讨论】:
-
您的帖子和这篇文章:home.xyzw.us/~cass/qcoord 提供了很好的帮助。
标签: opengl glsl perspective