Ok, sorry about that.
Think I've worked out texture atlas.
I've got a texture atlas of 1024x1024, textures are 64x64.
So, that is 1024 / 64 = 16 textures wide
1024 / 64 = 16 textures high
Then I just do 1 / 16 to give texture x-coordinate (i.e. 0.0625f )
and this is the same for texture y-coordinate.
So, to get 4th texture, I use this:
1 2 3 4 5 6 7 8
| GL11.glTexCoord2f(4.0f * 0.0625f, 1 * 0.0625f); GL11.glVertex3f(-0.1f, 0.1f, -0.1f); GL11.glTexCoord2f(4.0f * 0.0625f, 0.0f * 0.0625f); GL11.glVertex3f(-0.1f, 0.1f, 0.1f); GL11.glTexCoord2f(5 * 0.0625f, 0.0f * 0.0625f); GL11.glVertex3f( 0.1f, 0.1f, 0.1f); GL11.glTexCoord2f(5 * 0.0625f, 1 * 0.0625f); GL11.glVertex3f( 0.1f, 0.1f, -0.1f); |
Hope this may help somebody?!
Thanks,
Steve