Original Post
Hi, I'm displaying some test triangles using VBO, and I'm having some strange behaviour:
There should appear 2 small triangles, then 1 big, then 2 small and finally 1 big again. The code I use to display the scene is: (note that using glBegin - glEnd, the triangles work fine) Any ideas of WHY I'm getting this??? -Roger-
There should appear 2 small triangles, then 1 big, then 2 small and finally 1 big again. The code I use to display the scene is: (note that using glBegin - glEnd, the triangles work fine) gluLookAt(sm->ActiveCam->getEye().x, sm->ActiveCam->getEye().y, sm->ActiveCam->getEye().z, sm->ActiveCam->getLookat().x, sm->ActiveCam->getLookat().y, sm->ActiveCam->getLookat().z, 0, 1, 0);
//sm->ActiveCam->Translate(-0.05f);
//sm->ActiveCam->Rotate(1.0f,0.0f,1.0f,0.0f);
// *****************
sncsize = sm->getAttachedItems();
glEnableClientState( GL_VERTEX_ARRAY );
for (int i=0;i<sncsize;i++) {
// Parse list and get vertex list
vlist = sm->Node->draw();
glPushMatrix();
glVertexPointer(3, GL_FLOAT, 0, vlist->Vertices);
glTranslatef(8.0f*i, 0.0f, 0.0f);
glDrawArrays(GL_TRIANGLES, 0, vlist->VertexCount*3);
glPopMatrix();
vlist = NULL;
}
// *****************
glDisableClientState(GL_VERTEX_ARRAY);
SwapBuffers(hDC);