basic UV-Coords Q

Started by
2 comments, last by Supernat02 18 years, 8 months ago
Hi I think i missed a basic part of Texture Coordinate theory...i understand what the y are but while writing my maya exporter i noticed that one vertex can/must have multiple uvs...i thought i only need multiple UVs for different Textures, but you can't create a UVSet for a cube without given some vertices multiple UVs. but giving the Vertices more than one UV pair is not the porblem but how does the computer know which UV-pair to use for which traingle? Do you need one UV-pair for every UV-shell in the UV-map? btw does anyone know how the UV-indices that maya has work? I think that they work like this: UVs[UVIndices[VertexIndex]] like this one vertex can have multiple Uv Coord( i hope i got that right). regards, m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
Advertisement
I can't comment for Maya, as I've never used it. Given that Maya/3DSMax/Lightwave aren't necessarily tied to the hardware (although they often take advantage of it) they can use data structures and algorithms that might not be applicable or sensible for real-time D3D/OpenGL type programs.

In Direct3D you could probably use multiple texture coordinates and various blending tricks to stick with (for example) 8 vertices for a cube... but that wouldn't really make sense.

Typically you would use indexed geometry where multiple triangles share an **identical** vertex. Different texture coordinates or normals (another common problem) does not constitute a identical vertex.

For the cube example, you might need upto 36 vertices (..for a list, or 24 for a strip) to represent each face with unique properties such as normals and texcoords.

Maybe you'll have to perform some sort of "split" operation on Maya vertexes that have multiple texture coordinates for the same texture/layer.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

i also came to that idea but i thought there would be a better solution than splitting the mesh :( . I wanted to know how to interpret these UVindices because i'll have to convert this data structure to usual Vertices with 1 UVCoord each...

regards,
m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
I would expect that Maya, when exporting to .x, would keep a single set of UV coordinates and create 2 or more vertices for shared vertices. The easy way to find out would be to create a simple cube with the same texture applied to all 6 sides and export it as an ASCII .x file, then just look at the data. You should see more than 8 vertices.

Based on what Jack said, an example of a mesh that would have multiple triangles sharing the same vertex, BUT that vertex has the same UV coordinates is a landscape with a single texture applied over it. In the cube situation, you probably have a texture applied to each wall.
Chris ByersMicrosoft DirectX MVP - 2005

This topic is closed to new replies.

Advertisement