私はかなり奇妙な問題を抱えています。これらのスクリーンショットを見てください:
そのオブジェクトのコード:
void prostopadloscian(float x, float y, float z, float red, float green, float blue)
{
glBegin(GL_QUADS);
glColor3f(red, green, blue);
glNormal3f(-x,-y,-z);
glVertex3f(-x,-y,-z);
glNormal3f(x,-y,-z);
glVertex3f(x,-y,-z);
glNormal3f(x,-y,z);
glVertex3f(x,-y,z);
glNormal3f(-x,-y,z);
glVertex3f(-x,-y,z);
glNormal3f(-x,y,-z);
glVertex3f(-x,y,-z);
glNormal3f(x,y,-z);
glVertex3f(x,y,-z);
glNormal3f(x,y,z);
glVertex3f(x,y,z);
glNormal3f(-x,y,z);
glVertex3f(-x,y,z);
glNormal3f(-x,y,z);
glVertex3f(-x,y,z);
glNormal3f(-x,-y,z);
glVertex3f(-x,-y,z);
glNormal3f(-x,-y,-z);
glVertex3f(-x,-y,-z);
glNormal3f(-x,y,-z);
glVertex3f(-x,y,-z);
glNormal3f(-x,-y,-z);
glVertex3f(-x,-y,-z);
glNormal3f(x,-y,-z);
glVertex3f(x,-y,-z);
glNormal3f(x,y,-z);
glVertex3f(x,y,-z);
glNormal3f(-x,y,-z);
glVertex3f(-x,y,-z);
glNormal3f(x,y,z);
glVertex3f(x,y,z);
glNormal3f(x,-y,z);
glVertex3f(x,-y,z);
glNormal3f(x,-y,-z);
glVertex3f(x,-y,-z);
glNormal3f(x,y,-z);
glVertex3f(x,y,-z);
glNormal3f(-x,y,z);
glVertex3f(-x,y,z);
glNormal3f(-x,-y,z);
glVertex3f(-x,-y,z);
glNormal3f(-x,-y,-z);
glVertex3f(-x,-y,-z);
glNormal3f(-x,y,-z);
glVertex3f(-x,y,-z);
glEnd();
}
void bed()
{
glPushMatrix();
glTranslatef(-1.6, 0, 4.6);
prostopadloscian(0.2, 0.25, 0.2, 0.35, 0.16, 0.14);
glPopMatrix();
glPushMatrix();
glTranslatef(1.6, 0, 4.6);
prostopadloscian(0.2, 0.25, 0.2, 0.35, 0.16, 0.14);
glPopMatrix();
glPushMatrix();
glTranslatef(-1.6, 0, -4.6);
prostopadloscian(0.2, 0.25, 0.2, 0.35, 0.16, 0.14);
glPopMatrix();
glPushMatrix();
glTranslatef(1.6, 0, -4.6);
prostopadloscian(0.2, 0.25, 0.2, 0.35, 0.16, 0.14);
glPopMatrix();
glPushMatrix();
glTranslatef(0.0, 0.55, 0.0);
prostopadloscian(2,0.3,5,0.85,0.85,0.95);
glPopMatrix();
}
私のdisplay()関数はで始まります
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(1.0, 1.0, 1.0, 1.0);
glEnable(GL_DEPTH_TEST);
glDisable(GL_TEXTURE_2D);
glLoadIdentity();
この醜い効果を取り除く方法は?