Jump to content
  • Advertisement
Sign in to follow this  
m4gnus

basic UV-Coords Q

This topic is 4828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!