开发者

Figure out texture coordinate from 4 others?

Lets say I have 4 verticies and their texture coordinates. How could I then figu开发者_JAVA技巧re out the texture coords of a 5th vertex?

Thanks

say I have:

v1 = (0,0) tex coord(1,0)
v2....
v3...
v4...
v5 = (15,15) tex coord = ??

yea linear interpolation I suppose,

To figure out the coords I do:

vec.x / polywidth;
vec.y / polyheight;


texture mapping is about mapping a 2d space to your 3d model. There is no generic way to extrapolate texture coordinates, because those completely depend on how you want to map your texture to your surface. More to the point, there are many possible texture coordinates, that will map a different part of your texture to your mesh.

Now... If your mesh is a regular 2D grid (a special case), on which you want to map a texture uniformly (another special case), then yeah, linear interpolation of the texture coordinates based on the vertex positions would work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜