#### Archived

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

# UV Texture mapping in triangles vs vertices?

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

## 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 on other sites
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 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.

1. 1
2. 2
Rutin
20
3. 3
khawk
17
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633757
• Total Posts
3013711
×