1
votes

I'm parsing an OBJ-file in Android and my goal is to render & display the object. Everything works fine (vertices, textures etc) except the correct color mapping.

OpenGL expects a colorbuffer with rgb-values (+alpha) per vertex into glColorPointer, but the MTL offers three different color-values per material (diffuse,specular,ambient).

Question: How do I compute the expected rgb value for my vertex from these three types of color (diffuse,specular,ambient)? Right now I'm passing the diffusecolor when populating the colorbuffer (this is just a kind of playing around, because of not knowing the solution), the outcome is following:

link text

1

1 Answers

0
votes

You pass that data to glMaterial, not to glColorPointer. See the glMaterial reference page (OpenGL ES).