Hi,
I’ve got a model with vertex, normal and texture coordinates data and I want to draw this using DrawElemets. The problem is that each vertex has diffrent normal and texture coordinate.
DrawElements calls every enabled array element with given index. I want to call vertex array element with vertex index, normal array element with normal index and texcoords array element with texcoord index, respectively. Is it possible using arrays? I tried with InterleavedArrays but it gives no success. For now I’ve got a code for drawing (face arrays includes indices):
// this is only pseudo code, cutted for better reading
glBegin( GL_TRIANGLES );
for( int j = 0; j < numFaces; j++ )
{glTexCoord2fv( texCoords[ texcoords_faces[j] ] );
glNormal3fv( normals[ normal_faces[j] ] );
glVertex3fv( vertices[ vertices_faces[j] ] );
}
glEnd();
Thanks for help