我无法绘制颜色材料。如何绘制彩色材料?我尝试了下面的代码:
glMaterialfv(GL_FRONT, GL_AMBIENT, material._Ka);
glMaterialfv(GL_FRONT, GL_DIFFUSE, material._Kd);
glMaterialfv(GL_FRONT, GL_SPECULAR, material._Ks);
// glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, ...);
glMaterialfv(GL_FRONT, GL_SHININESS, material.Ns);
//glColor4fv(material._Kd);
glColorMaterial(GL_FRONT, GL_DIFFUSE);
glColorMaterial(GL_FRONT, GL_SPECULAR);
glColorMaterial(GL_FRONT, GL_AMBIENT);
glColorMaterial(GL_FRONT, GL_SHININESS);
这会导致以下错误(错误 1280):
glColorMaterial(GL_FRONT, GL_SHININESS);