2

这是输出的样子: 对象重叠的屏幕截图

我的代码是这样的:

(...)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glColor3f(1.0f, 1.0f, 1.0f);
glTranslatef(-10,0,0);
glRotatef(-17.14f,0,1,0);

////////////////////////////////////////////////////////////////////
for(int i=1;i<=21;i++){
    glTranslatef(10,0,0);
    glRotatef(17.14f,0,1,0);

    glBegin(GL_QUADS);
    glTexCoord2f(0.0f, 0.0f);glVertex3f(-BOX_SIZE / 2, -BOX_SIZE / 2, BOX_SIZE / 2);
    glTexCoord2f(1.0f, 0.0f);glVertex3f(BOX_SIZE / 2, -BOX_SIZE / 2, BOX_SIZE / 2);
    glTexCoord2f(1.0f, 1.0f);glVertex3f(BOX_SIZE / 2, BOX_SIZE / 2, BOX_SIZE / 2);
    glTexCoord2f(0.0f, 1.0f);glVertex3f(-BOX_SIZE / 2, BOX_SIZE / 2, BOX_SIZE / 2);
    glEnd();

}
(...)

它基本上是一个旋转的图像磁盘(稍后将更改它们)。

4

1 回答 1

3

启用深度缓冲

于 2012-04-16T14:30:59.843 回答