Hi.
Imagine a very basic Texture atlas, looking roughly like this: (A and B are the 2 different pieces).
AAB
AA
Now, judging from this, piece A can be found at
1
| [ left: 0.0f, bottom: 0.0f, right: 0.66667f, top: 1.0f ] |
I have always imagined, and was sure that piece B could be found at
1
| [ left: 0.66667f, bottom: 0.5f, right: 1.0f, top: 1.0f ] |
However, that's not coming out right at all. Piece B IS coming out right at
1
| [ left: 0.66667f, bottom: 0.0f, right: 1.0f, top: 0.5f ] |
however.
I render as triangles, and my data for rendering B looks like this:
Vertexbuffer
1 2 3 4 5 6
| float[] { x - 64, y + 64, x - 64, y - 64, x + 64, y - 64, x + 64, y + 64 } |
Texturebuffer (doesnt work, but what I thought was correct)
1 2 3 4 5 6
| float[] { 0.66667f, 1.0f, 0.66667f, 0.5f, 1.0f,0.5f, 1.0f,1.0f } |
Texturebuffer (works, but what I thought was wrong)
1 2 3 4 5 6
| float[] { 0.66667f, 0.5f, 0.66667f, 0.0f, 1.0f,0.0f, 1.0f,0.5f } |
I hope my question is understandable, and that someone can explain to me what's going on here.