title: Using sketch up data to render a cube in Xcode
body: <p>I am playing around with the OpenGL ES template in Xcode 4.5. I draw a cube in Google Sketchup and exported into collada. I copied the vertex and normal data into the open gl template in Xcode as below:</p>
  
  <pre><code>GLfloat gCubeVertexData[] =
  {
      // Data layout for each line below is:
      // positionX, positionY, positionZ,     normalX, normalY, normalZ,
  //    0.5f, -0.5f, -0.5f,        1.0f, 0.0f, 0.0f,
  //    0.5f, 0.5f, -0.5f,         1.0f, 0.0f, 0.0f,
  //    0.5f, -0.5f, 0.5f,         1.0f, 0.0f, 0.0f,
  //    0.5f, -0.5f, 0.5f,         1.0f, 0.0f, 0.0f,
  //    0.5f, 0.5f, -0.5f,         1.0f, 0.0f, 0.0f,
  //    0.5f, 0.5f, 0.5f,          1.0f, 0.0f, 0.0f,
  //    
  //    0.5f, 0.5f, -0.5f,         0.0f, 1.0f, 0.0f,
  //    -0.5f, 0.5f, -0.5f,        0.0f, 1.0f, 0.0f,
  //    0.5f, 0.5f, 0.5f,          0.0f, 1.0f, 0.0f,
  //    0.5f, 0.5f, 0.5f,          0.0f, 1.0f, 0.0f,
  //    -0.5f, 0.5f, -0.5f,        0.0f, 1.0f, 0.0f,
  //    -0.5f, 0.5f, 0.5f,         0.0f, 1.0f, 0.0f,
  //    
  //    -0.5f, 0.5f, -0.5f,        -1.0f, 0.0f, 0.0f,
  //    -0.5f, -0.5f, -0.5f,       -1.0f, 0.0f, 0.0f,
  //    -0.5f, 0.5f, 0.5f,         -1.0f, 0.0f, 0.0f,
  //    -0.5f, 0.5f, 0.5f,         -1.0f, 0.0f, 0.0f,
  //    -0.5f, -0.5f, -0.5f,       -1.0f, 0.0f, 0.0f,
  //    -0.5f, -0.5f, 0.5f,        -1.0f, 0.0f, 0.0f,
  //    
  //    -0.5f, -0.5f, -0.5f,       0.0f, -1.0f, 0.0f,
  //    0.5f, -0.5f, -0.5f,        0.0f, -1.0f, 0.0f,
  //    -0.5f, -0.5f, 0.5f,        0.0f, -1.0f, 0.0f,
  //    -0.5f, -0.5f, 0.5f,        0.0f, -1.0f, 0.0f,
  //    0.5f, -0.5f, -0.5f,        0.0f, -1.0f, 0.0f,
  //    0.5f, -0.5f, 0.5f,         0.0f, -1.0f, 0.0f,
  //    
  //    0.5f, 0.5f, 0.5f,          0.0f, 0.0f, 1.0f,
  //    -0.5f, 0.5f, 0.5f,         0.0f, 0.0f, 1.0f,
  //    0.5f, -0.5f, 0.5f,         0.0f, 0.0f, 1.0f,
  //    0.5f, -0.5f, 0.5f,         0.0f, 0.0f, 1.0f,
  //    -0.5f, 0.5f, 0.5f,         0.0f, 0.0f, 1.0f,
  //    -0.5f, -0.5f, 0.5f,        0.0f, 0.0f, 1.0f,
  //    
  //    0.5f, -0.5f, -0.5f,        0.0f, 0.0f, -1.0f,
  //    -0.5f, -0.5f, -0.5f,       0.0f, 0.0f, -1.0f,
  //    0.5f, 0.5f, -0.5f,         0.0f, 0.0f, -1.0f,
  //    0.5f, 0.5f, -0.5f,         0.0f, 0.0f, -1.0f,
  //    -0.5f, -0.5f, -0.5f,       0.0f, 0.0f, -1.0f,
  //    -0.5f, 0.5f, -0.5f,        0.0f, 0.0f, -1.0f
  
  
      9.8425197/9.8425197, 9.8425197/9.8425197, 0.0000000/9.8425197,    0.0000000, 0.0000000, -1.0000000,
      0.0000000/9.8425197, 0.0000000/9.8425197, 0.0000000/9.8425197,    0.0000000, 0.0000000, -1.0000000,
      0.0000000/9.8425197, 9.8425197/9.8425197, 0.0000000/9.8425197,    0.0000000, 0.0000000, -1.0000000,
      9.8425197/9.8425197, 0.0000000/9.8425197, 0.0000000/9.8425197,    0.0000000, 0.0000000, -1.0000000,
      0.0000000/9.8425197, 9.8425197/9.8425197, 8.2677165/9.8425197,    -1.0000000, 0.0000000, 0.0000000,
      0.0000000/9.8425197, 0.0000000/9.8425197, 0.0000000/9.8425197,    -1.0000000, 0.0000000, 0.0000000,
  
      0.0000000/9.8425197, 0.0000000/9.8425197, 8.2677165/9.8425197,    -1.0000000, 0.0000000, 0.0000000,
      0.0000000/9.8425197, 9.8425197/9.8425197, 0.0000000/9.8425197,    -1.0000000, 0.0000000, 0.0000000,
      0.0000000/9.8425197, 9.8425197/9.8425197, 8.2677165/9.8425197,    -0.0000000, 1.0000000, 0.0000000,
      9.8425197/9.8425197, 9.8425197/9.8425197, 0.0000000/9.8425197,    -0.0000000, 1.0000000, 0.0000000,
      0.0000000/9.8425197, 9.8425197/9.8425197, 0.0000000/9.8425197,    -0.0000000, 1.0000000, 0.0000000,
      9.8425197/9.8425197, 9.8425197/9.8425197, 8.2677165/9.8425197,    -0.0000000, 1.0000000, 0.0000000,
  
      9.8425197/9.8425197, 9.8425197/9.8425197, 0.0000000/9.8425197,    1.0000000, 0.0000000, 0.0000000,
      9.8425197/9.8425197, 0.0000000/9.8425197, 8.2677165/9.8425197,    1.0000000, 0.0000000, 0.0000000,
      9.8425197/9.8425197, 0.0000000/9.8425197, 0.0000000/9.8425197,    1.0000000, 0.0000000, 0.0000000,
      9.8425197/9.8425197, 9.8425197/9.8425197, 8.2677165/9.8425197,    1.0000000, 0.0000000, 0.0000000,
      9.8425197/9.8425197, 0.0000000/9.8425197, 8.2677165/9.8425197,    -0.0000000, -1.0000000, -0.0000000,
      0.0000000/9.8425197, 0.0000000/9.8425197, 0.0000000/9.8425197,    -0.0000000, -1.0000000, -0.0000000,
  
      9.8425197/9.8425197, 0.0000000/9.8425197, 0.0000000/9.8425197,    -0.0000000, -1.0000000, -0.0000000,
      0.0000000/9.8425197, 0.0000000/9.8425197, 8.2677165/9.8425197,    -0.0000000, -1.0000000, -0.0000000,
      9.8425197/9.8425197, 0.0000000/9.8425197, 8.2677165/9.8425197,    0.0000000, 0.0000000, 1.0000000,
      0.0000000/9.8425197, 9.8425197/9.8425197, 8.2677165/9.8425197,    0.0000000, 0.0000000, 1.0000000,
      0.0000000/9.8425197, 0.0000000/9.8425197, 8.2677165/9.8425197,    0.0000000, 0.0000000, 1.0000000,
      9.8425197/9.8425197, 9.8425197/9.8425197, 8.2677165/9.8425197,    0.0000000, 0.0000000, 1.0000000
  };
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/omjut.jpg" alt="enter image description here"></p>
  
  <p>When I run, I have the rendered cube below, so something is not right.</p>
  
  <p>=======</p>
  
  <p>It looks like if I am using normals, I don't need to provide the indices to render a 3D object. But in my case there seems to be something out of order either in the vertex data or normal... Does any one know how in collada this two data are arranged? I read through the documentation but I couldn't find an answer... Thanks </p>