title: Problems loading .dae files, indices and vertices load correct
body: <p>So after reading <a href="https://stackoverflow.com/questions/11148567/rendering-meshes-with-multiple-indices">this</a> I thought it would be better to change to format i load my files in and decided to use .dae files. After writing this very simple xml-loader:</p>
  
  <pre><code>void Model::loadModelFromDae(std::string source)
  {
      using namespace std;
      string name = source.substr(0,source.find("."));
      cout&lt;&lt;"+++LOADING::"&lt;&lt;name&lt;&lt;"+++"&lt;&lt;endl;
  
      ifstream file;
      file.open(source);
      string line;
      size =0;
      indexSize=0;
  
      while(getline(file,line))
      {
          /*possible float_array's: vertices and normal*/
          if(std::string::npos != line.find("&lt;float_array"))
          {
              if(std::string::npos != line.find("positions"))
              {
                  //get the size of the vertices float_array
                  int loc_count = line.find("count");
                  // to explain the hardcoded values: count=" is 7 char's
                  string cout_substr = line.substr(line.find("count"),line.find("&gt;"));
                  cout_substr = cout_substr.substr(7,cout_substr.find("\"")); 
                  size = atoi(cout_substr.c_str());
                  cout&lt;&lt;"\tSIZE:"&lt;&lt;size&lt;&lt;endl;
                  vertices = new float[size];
                  memset(vertices,0.0f,sizeof(float)*size);
  
                  string values = line.substr(line.find("count")+11,line.size());
                  values = values.substr(0,values.size()-14);
                  std::stringstream converter(values);
                  vector&lt;float&gt; temp;
                  // Iterate over the istream, using &gt;&gt; to grab floats
                  // and push_back to store them in the vector
                  std::copy(std::istream_iterator&lt;float&gt;(converter),
                      std::istream_iterator&lt;float&gt;(),
                      std::back_inserter(temp));
                  for(int i=0;i&lt;temp.size();i++) vertices[i] = temp.at(i);
              }
              //TODO: handle normal array
          }
          /*Handling indices*/
          if(std::string::npos != line.find("&lt;p&gt;"))
          {
              string values = line.substr(line.find("&gt;")+1,line.length());
              values = values.substr(0,values.length()-4);
              std::stringstream converter(values);
              vector&lt;short&gt; temp;
              // Iterate over the istream, using &gt;&gt; to grab shorts
              // and push_back to store them in the vector
              std::copy(std::istream_iterator&lt;short&gt;(converter),
                  std::istream_iterator&lt;short&gt;(),
                  std::back_inserter(temp));
              indices = new short[temp.size()];
              indexSize = temp.size();
              cout&lt;&lt;"\tINDEXSIZE:"&lt;&lt;indexSize&lt;&lt;endl;
              for(int i=0;i&lt;temp.size();i++) indices[i] = temp.at(i);
          }
      }
  
      cout&lt;&lt;"+++ENDED LOADING +DAE+ FILE:"&lt;&lt;name&lt;&lt;"+++"&lt;&lt;endl;
  }
  </code></pre>
  
  <p>I still have a few problems: I'm trying to load a cube, and checked each vertex/index and they exactly match the XML-file but the output is not at all what i expect: the cube renders the triangles, but not in the order they should be. So I got a few questions:</p>
  
  <ul>
  <li>Does .dae save it's indices in a different format then openGL takes
  it?</li>
  <li>(Optional because it requires a lot of debugging) Can you spot my mistake, my initial thought was that the facing of the vertices is
  wrong but putting <code>glFrontFace(GL_CCW);</code> or <code>glFrontFace(GL_CW);</code>
  doesn't change anything.</li>
  </ul>