Hi!
I wondering if you need to do something special with the vertex data and index data loaded from the OBJ file, to make it appear on screen?
I have done a test in the code to specify the data directly in the code instead of loading it from an OBJ file. This to see if it looks ok.
for instance: This is just an example so you get the idea of my problem
float vertices2[] = {0.004520f, 0.000000f, -0.363459f,
0.179520f, 0.000000f, -0.315091f,
0.004520f, 0.000000f, -0.002436f,
0.004520f, 1.390251f, -0.363459f,
0.003921f, 1.528259f, 0.001508f,
0.179520f, 1.390251f, -0.315091f
};
short indices[] = {1, 2, 3,
4, 5, 6};
ByteBuffer vbb = ByteBuffer.allocateDirect(vertices2.length * 4);
vbb.order(ByteOrder.nativeOrder());
mVertexBuffer2 = vbb.asFloatBuffer();
mVertexBuffer2.put(vertices2);
vbb = ByteBuffer.allocateDirect(indices.length * 4);
vbb.order(ByteOrder.nativeOrder());
mIndexBuffer2 = vbb.asShortBuffer();
mIndexBuffer2.put(indices);
Later in the "Draw" method I try to draw the object on the screen. Using glVertexPointer and glDrawElements.
gl.glVertexPointer(3, GL10.GL_FIXED, 0, mVertexBuffer2);
gl.glDrawElements(GL10.GL_TRIANGLES, mIndexCount, GL10.GL_UNSIGNED_SHORT, mIndexBuffer2);
The problem is that I can see something on the screen but it is absolutely not what should be there.
If I hard code the data of a Penguin, it's not a penguin I see on the screen.
What am I doing wrong here?
Thanks



