PDA

View Full Version : Texture coordinates need to change when I change triangulation?



Grognard
12-05-2016, 12:01 AM
Looks like I did something dumb with my importer and did not realize it until now.

Probably a dumb question, but if I change my triangles around do I need to change the coordinates as well? Or should the same vertex always have the same coords? That is what makes sense to me but maybe I am missing something.

Silence
12-05-2016, 12:13 AM
Well, the same spatial position should refer to the same 2D position normally. This is true as long as the texture image stays the same and the original 3D model could be told to remain the same.

What do you exactly mean by:



if I change my triangles around do I need to change the coordinates as well
?

Grognard
12-05-2016, 01:08 AM
I thought maybe if I changed the order of winding that I needed to reverse the coordinates or something.

But it looks like I do have the right UVs initially and somehow I am borking them up. So nevermind.

Silence
12-05-2016, 01:35 AM
Texture mapping is a projection. For one (x,y,z) triplet, there is one and only one corresponding (u,v) couple.