开发者_StackOverflow社区I have a polygon, where each vertex has texture coordinates. How can I calculate texture coord for any point lying in the polygon? (I know points coordinates.) Thanks
p.s. sorry for my english...
I you don't care about perspective than it's simple enough. simply find the barycentric coordinates of the point and do a linear interpolation of the vertices texture coordinates. Here's a nice tutorial about this
If however you're trying to do this in a scene where with a perspective projection, you'll probably want to worry about perspective correction as well. Here's some reading about this issue
精彩评论