开发者

textureMappingu/v in common Vertex structures?

开发者 https://www.devze.com 2022-12-12 15:49 出处:网络
Looking through some directx examples, I\'m often seeing the structure for a vertex to be defined as such:

Looking through some directx examples, I'm often seeing the structure for a vertex to be defined as such:

struct Vertex
{
    vector position;
    ve开发者_如何学运维ctor normal;
    int textureMappingu;
    int textureMappingv;
}

Under this type of vertex, what are textureMappingu/v for?


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.

0

精彩评论

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