This thread on OpenGL.org discussed the problem of modeling package multiple vertex index streams (texture vertices versus position vertices) and what to do about it when you want to render with OpenGL (or Direct3D). Here's some untested code I wrote which purports to generate a stream of vertices which is drawable with a single index. Note that it does not do anything special to try and improve the vertex cache on modern cards or anything like that, but the idea works well enough anyway:

Please note that this code is un-tested, but ought to work with minimal adjustment! I'm also placing this code in the public domain, so no license worries (as if it's big enough to worry about anyway :-)

struct pos {
  float x, y, z;
  bool operator==( pos const & other ) const {
    return x == other.x && y == other.y && z == other.z;
  }
};
struct uv {
  float u, v;
  bool operator==( uv const & other ) const {
    return u == other.u && v == other.v;
  }
};
struct vert {
  pos p; 
  uv t;
  bool operator==( vert const & other ) const {
    return p == other.p && t == other.t;
  }
};
struct two_indices {
  int p;
  int t;
};

// assuming you pass "enough" space in // vertOut and ixOut int normalize_arrays( pos const * posIn, uv const * uvIn, two_indices const * ixIn, int ixInCount, vert * vertOut, int * ixOut ) { int oCount = 0; int oUsed = 0; for( int ix = 0; ix < ixInCount; ++ix ) { vert v; v.p = posIn[ ixIn[ ix ].p ]; v.t = uvIn[ ixIn[ ix ].t ]; for( int f = 0; f < ix; ++f ) { if( v == vertOut[ f ] ) { ixOut[ oCount ] = f; goto next_vert; } } vertOut[ oUsed ] = v; ixOut[ oCount ] = oUsed; ++oUsed; next_vert: ++oCount; } assert( oCount == ixInCount ); return oUsed; }

You can make this code smarter so it's not N squared complexity, but typically you'll only run this code when exporting a model from some modeler, so performance isn't critical.