I got really close to rendering this texture to a quad and it’s not working right. HEre is my Vertex data:
EDIT: Sorry for the not so descriptive problem (was in a rush this morning). So I draw this texture using VBOs. This is just my vertex data I use to render it. Since I’m pretty new to LWJGL, do you know what I’m doing wrong to make the texture look this way?
FloatBuffer vertexData = BufferUtils.createFloatBuffer(amountOfVertices * vertexSize);
vertexData.put(new float[]{ -0.5f, 0.5f, 0,//LEFT BOTTOM
-0.5f, -0.5f, 0,
0.5f, -0.5f, 0,
0.5f, -0.5f, 0,//RIGHT TOP
0.5f, 0.5f, 0,
-0.5f, 0.5f, 0,
});
vertexData.flip();
Texture Data:
FloatBuffer textureUVData = BufferUtils.createFloatBuffer(amountOfVertices * 2); // amount of vertices * two texture coordinates per-vertex
textureUVData.put(new float[]{0,1 , 0,0 , 1,0 , 1,1 /**/, 0,1 , 0,0 });
textureUVData.flip();
Color Data:
FloatBuffer colorData = BufferUtils.createFloatBuffer(amountOfVertices * colorSize);
colorData.put(new float[]{1, 1, 1, 1, 1, 1, 1, 1, 1, /**/1, 1, 1, 1, 1, 1, 1, 1, 1});
colorData.flip();
The image drawn using this code.
http://i.minus.com/iydVAJMz77MX1.gif
As you may notice, it looks a bit odd compared to what it’s supposed to be: