java - How would you pass an OBJ files face definitions to openGL -


I've written the OBJ loader which parse the corners, textures, cores and normals, each stored in a float buffer, And passed for Open:

  gl.glVertexPointer (3, GL10.GL_FLOAT, 0, FBArtists); Gl.glNormalPointer (GL10.GL_FLOAT, 0, FB general);  

However, how do I want to pass my index buffer to glDrawElements, I have read that index index is corner, texture, and normal, but reading the OBJ file description seems to be Fractions are deposited in a format like this:

  f 1/2/3 4/5/6 7/8/9  

With the format

  vertice / texture / normal  

glDrawElements accepts only 1 index, which should be for reference all 3, but when I I see a real Obije file, it does not seem possible. How do you pass the index for everyone?

You can find a copy of the code here:

You can not do OpenGL, you need to do some preprocessing before passing the data, so only one index is used for each head, and this index works for textured coordinates, normals, etc.


Comments