Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

FireAndGlass

UV Texture mapping in triangles vs vertices?

This topic is 5218 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

I''m trying to import some 3D data into my game from 3DS Files... I notice that Mapping coordinates are by vertices. When I was designing my texture mapper, I first started this way, but stopped about half way through thinking that wraparound for say wallpaper in a room was impossible, so I coded the UV info into the triangle struct instead of the vertices. But I guess i''m wrong? How does this work? Simple example: a room that''s a cube, 4 walls, floor celing. I would like a wallpaper to go around the room perfectly, but like wallpapers, they repeat, so I would say want the whole texture to fit on one wall. But say some corner has texture information - on one wall it will be the end of the texture (u = 1) and on the other end it will be the start (u = 0) how does this work? true you could have it go 0 to 1 on one wall, 1 to 2, but then when it meets back up with the original wall what happens? how does this work? Also what about for the case that there might be a section with a different texture that might need different mappings. How does that work?

Share this post


Link to post
Share on other sites
Advertisement
This works by having two vertices instead of one in the corner. They vertices have the same location, but they clearly are different by having different texture coordinates.

Share this post


Link to post
Share on other sites
And since it''s the logical follow up question...

Yes, the exact same thing is needed because the walls have different normals.

Basically, along any sharp edge (where normals vary), or texture seam (where UVs vary), you''ll need to duplicate vertices.

Share this post


Link to post
Share on other sites

  • 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!