常见顶点结构中的textureMappingu/v?
通过查看一些 directx 示例,我经常看到顶点的结构定义如下:
struct Vertex
{
vector position;
vector normal;
int textureMappingu;
int textureMappingv;
}
在这种类型的顶点下,textureMappingu/v 有何用途?
Looking through some directx examples, I'm often seeing the structure for a vertex to be defined as such:
struct Vertex
{
vector position;
vector normal;
int textureMappingu;
int textureMappingv;
}
Under this type of vertex, what are textureMappingu/v for?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用于纹理映射。向量[u,v]是纹理空间中顶点的坐标(显然是2D纹理)。在这种情况下,一张图片的价值胜过一千个单词 - 看看每个顶点如何映射到纹理上以及纹理面如何“扭曲”,以便三角形区域具有相同的纹理分辨率。
替代文本 http://www.cheetah3d.com/img/about/uv_pic3.png< /a>
如果您需要了解更多信息 - 查找 UV 映射。
Used for texture mapping. Vector [u,v] is coordinate of vertex in texture space (2D texture obviously). One picture is worth more than thousand words in this case - see how each vertex is mapped onto texture and how is texture face "warped" so triangle areas has same texture resolution.
alt text http://www.cheetah3d.com/img/about/uv_pic3.png
If you need to know more - look for UV mapping.