views:

251

answers:

1

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?

+4  A: 

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

If you need to know more - look for UV mapping.

MaR
+1 for the nice picture. The left part represents the texture used on the head, overlaid with each primitive of the head, in the UV space.
Bahbar
Thanks for the correction.
Georg Fritzsche