comment
This commit is contained in:
parent
eb6101d2ec
commit
b2dbf16329
|
@ -103,13 +103,16 @@ public class Mesh {
|
||||||
|
|
||||||
colorBufferObject = storeData(colorBuffer, 1, 3);
|
colorBufferObject = storeData(colorBuffer, 1, 3);
|
||||||
|
|
||||||
|
|
||||||
|
// Putting texture into the buffer so renderer and shader can read it
|
||||||
|
|
||||||
FloatBuffer textureBuffer = MemoryUtil.memAllocFloat(vertices.length * 2);
|
FloatBuffer textureBuffer = MemoryUtil.memAllocFloat(vertices.length * 2);
|
||||||
float[] textureData = new float[vertices.length * 3];
|
float[] textureData = new float[vertices.length * 3];
|
||||||
for (int i = 0; i < vertices.length; i ++ ) {
|
for (int i = 0; i < vertices.length; i ++ ) {
|
||||||
textureData[i * 2] = vertices[i].getTextureCoordinates().getX();
|
textureData[i * 2] = vertices[i].getTextureCoordinates().getX();
|
||||||
textureData[i * 2 + 1] = vertices[i].getTextureCoordinates().getY();
|
textureData[i * 2 + 1] = vertices[i].getTextureCoordinates().getY();
|
||||||
}
|
}
|
||||||
textureBuffer.put(colorData).flip();
|
textureBuffer.put(textureData).flip();
|
||||||
|
|
||||||
textureBufferObject = storeData(textureBuffer, 2, 2);
|
textureBufferObject = storeData(textureBuffer, 2, 2);
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user