如何在多维数据集的顶部创建一个洞,即对象上的布尔操作?

时间:2014-03-20 09:06:44

标签: c opengl

由于我是OpenGL的新手,我希望在我使用模板的固体对象上执行操作,但是dint按预期获得输出。任何人都可以帮忙吗?

代码:

void display(void)
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glScalef(zx,zy,zz);
glRotatef(xrot,1.0,0.0,0.0);
glRotatef(yrot,0.0,1.0,0.0);
glMatrixMode(GL_PROJECTION);

glEnable(GL_DEPTH);
glEnable(GL_STENCIL_TEST);
glColorMask(false,false,false,false);
glStencilOp(GL_REPLACE,1,1);
glStencilFunc(GL_EQUAL,1,1);
//  glRenderMode(GL_FLAT||GL_PROJECTION);

GLUquadricObj *quadratic;
    quadratic = gluNewQuadric();
    glutSolidCylinder(rtri,.50,15,15);

    glColorMask(true,true,true,true);
    glStencilFunc(GL_NOTEQUAL,1,1);
    glStencilOp(GL_KEEP,GL_KEEP,GL_KEEP);
    glBegin(GL_QUADS);

//code for cube!!




   glFlush();
  glutSwapBuffers();

   }

0 个答案:

没有答案