I have a trouble with understanding mapping of texture in OpenGL ES. For example, i have a little obj-file containing information like this:
- v -75 75 -50
- v 75 75 -50
- v -75 -75 -50
v 75 -75 -50
vt 0 0
- vt 0 1
- vt 1 1
vt 1 0
f 4/3 3/2 1/1
- f 2/4 4/3 1/1
If I use this vts then texture isn't mapping correctly. But If I switch vts like this:
- vt 1 0
- vt 0 1
- vt 1 1
- vt 0 0
all start working fine. I tryed to draw this coordinates just to get visual representation of them and get image like this (I inverted y-axis coordinates). http://imgur.com/BRQgKay In first case I see good representation, but it doesn't work, heh. In second case, I see something horrible, but it work. Why it works, I completely cannot understand. Any ideas? Thanks for any help. EDIT: https://i.stack.imgur.com/4YdpM.jpg I added a little explanation of result that I got. We can divide texture by two parts (triangles). In first case, I get this part switched around diagonal. In second case, I get a good mapping according to divided texture, but I cannot understand why it works. Sorry, if my explanation not so clear.