Halp plz [solved]
Posted: Wed May 19, 2010 11:02 am
I try not to seek help unless I really need it, but I'm really failing with VBO's. After fail #2 things were better but its still not right, can anyone help??
Here's what going on..
Anvil.obj ->
Code for data offset in buffer ->
Code snippet for this fail->
The data is used sizeof(float)*3 by default I think.
Code snippet for this fail->
Here I added data padding sizeof(float)*4 which, seemed to fix things a little?! But it's still messed up.
Here's what going on..
Anvil.obj ->
Code: Select all
1 Texture
50 Faces
150 Verts (vec3)
150 Normals (vec3)
150 TexCoords (vec2)
Code: Select all
#define BUFFER_OFFSET(i) ((char*)NULL + (i))
The data is used sizeof(float)*3 by default I think.
Code: Select all
glVertexPointer(3, GL_FLOAT, 0, BUFFER_OFFSET(OffsetPosition));
glNormalPointer(GL_FLOAT, 0, BUFFER_OFFSET(OffsetNormal));
glTexCoordPointer(2, GL_FLOAT, 0, BUFFER_OFFSET(OffsetTexcoord));
Code snippet for this fail->
Here I added data padding sizeof(float)*4 which, seemed to fix things a little?! But it's still messed up.
Code: Select all
glVertexPointer(3, GL_FLOAT, 16, BUFFER_OFFSET(OffsetPosition));
glNormalPointer(GL_FLOAT, 16, BUFFER_OFFSET(OffsetNormal));
glTexCoordPointer(2, GL_FLOAT, 16, BUFFER_OFFSET(OffsetTexcoord));