【问题标题】:issue with glDrawElementsglDrawElements 的问题
【发布时间】:2010-06-19 02:04:12
【问题描述】:

这显示为红色:

VertexColorSet(&colors[vertexCounter], 1.0f, 0.0f, 0.0f, 1.0f);

这显示黑色:

VertexColorSet(&colors[vertexCounter], 0.9f, 0.0f, 0.0f, 1.0f);

为什么黑色不应该是深红色?

    glEnableClientState(GL_COLOR_ARRAY);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);

glVertexPointer(2, GL_FLOAT, 0, vertexes);
glColorPointer(4, GL_FLOAT, 0, colors);
glDrawElements(GL_TRIANGLES, 3*indexesPerButton*totalButtons, GL_UNSIGNED_SHORT, indexes);

//glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    glDisableClientState(GL_COLOR_ARRAY);

【问题讨论】:

    标签: iphone opengl-es


    【解决方案1】:

    是的,它是黑色的,因为我使用的是 int 而不是 float

    【讨论】:

    • 谢谢你我试过了,但你必须等待几天才能接受答案。
    猜你喜欢
    • 2016-12-13
    • 2010-11-24
    • 1970-01-01
    • 1970-01-01
    • 2015-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多