D3D Texture Coordinates
Hi all,
I''ve got a really simple question, but for me it is currently one of those things that I keeps me awake at night and bashing my head against the wall in my waking hours.
Here it goes: how exactly does the u and v coordinates work?
At the current point in time it is a hit and miss afair. According to the documentation,
u = sx - o
v = sy - o
When I do mapping to a rectangle with ulc (-5, 1, -5) and lrc (-4, 0, -5) and work out the u and v mappings according to the coordinates it the textures are turned upside-down. (normal for this is (0, 0, -1)) Now, thinking fast, I changes all u 0''s to 1''s and all v 0''s to 1''s and the texture is placed correctly. Until I view the square from the back...
The back used to be all scew, but I seem to have fixed it by the order in which I place the vertexes, i.e. u,u in the order (0, 0), (0, 1), (1, 0), (1, 1). The back is the correct side up, but seems to start in the middle. (Some progress have been made...)
Obivously when I do squares in the z plane (y = constant) I get some different results.
I''m missing something seriously here, how exactly and in what order in the u and v coordinates supposed to be used? I need an understanding around this - at this moment it seems like a black-magic affair to me.
Thanks in advance for the help,
ikklit
Me again,
I''ve just read a post of the DirectX mailing list in which it seems that a recommended order of the vertexes, in u,v format might be:
(0, 0)
(1, 0)
(1, 1)
(0, 1)
I don''t know if this has something to do with the problems I''m having. Maybe my order is just totally screwed up. The more I learn, the less I know
Seems like I''m really lacking understanding.
I''ve just read a post of the DirectX mailing list in which it seems that a recommended order of the vertexes, in u,v format might be:
(0, 0)
(1, 0)
(1, 1)
(0, 1)
I don''t know if this has something to do with the problems I''m having. Maybe my order is just totally screwed up. The more I learn, the less I know

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement