开发者

OpenGL & OBJ: How to fill glcolorpointer with colors from MTL

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,am开发者_StackOverflowbient).

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜