简体   繁体   English

找出另外4个纹理坐标?

[英]Figure out texture coordinate from 4 others?

Lets say I have 4 verticies and their texture coordinates. 可以说我有4个顶点及其纹理坐标。 How could I then figure 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. 纹理映射是关于将2d空间映射到3d模型。 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. 现在...如果您的网格是常规2D网格(一种特殊情况),要在其上均匀地映射纹理(另一种特殊情况),那么可以,基于顶点位置对纹理坐标进行线性插值将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM