textureMappingu/v in common Vertex structures?
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.
精彩评论