Changeset 12079 for trunk


Ignore:
Timestamp:
09/13/11 09:26:39 (13 years ago)
Author:
lyard
Message:
trying to enable depth test
Location:
trunk/FACT++/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/BasicGlCamera.cc

    r12074 r12079  
    3838    BasicGlCamera::BasicGlCamera(QWidget* cParent) : QGLWidget(cParent)
    3939    {
    40         setFormat(QGLFormat(QGL::DoubleBuffer));// | QGL::DepthBuffer));
     40        setFormat(QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer));
    4141        fWhite = -1;
    4242        fWhitePatch = -1;
     
    505505        glVertex2f(zeroX, -zeroY);
    506506        glEnd();
     507        glTranslatef(0,0,0.1f);
     508
    507509        //draw linear/log tick marks
    508510        glColor3f(0.f,0.f,0.f);
     
    647649        qglClearColor(QColor(25,25,38));
    648650        glShadeModel(GL_FLAT);
    649         glDisable(GL_DEPTH_TEST);
     651        glEnable(GL_DEPTH_TEST);
    650652        glDisable(GL_CULL_FACE);
    651653
  • trunk/FACT++/gui/QCameraWidget.cc

    r12073 r12079  
    1919    void QCameraWidget::paintGL()
    2020    {
    21         glClear(GL_COLOR_BUFFER_BIT);
     21        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    2222         glLoadIdentity();
    2323
     
    3434             glTranslatef(0.45,-0.45,0);
    3535         }
    36          glScalef(1.5, 1.5, 1.5);
     36         glScalef(1.5, 1.5, 1.0);
     37         glTranslatef(0,0,-0.5);
    3738         drawCamera(true);
     39         glTranslatef(0,0,0.1f);
    3840
    3941         drawPatches();
     42         glTranslatef(0,0,0.1f);
    4043
    4144         glLineWidth(1.0f);
     
    4750
    4851        glLineWidth(1.0f);
     52        glTranslatef(0,0,0.1f);
    4953
    5054        //glColor3f(1.f - pixelsColor[fWhite][0],1.f - pixelsColor[fWhite][1],1.f - pixelsColor[fWhite][2]);
     
    7579        if (!alsoWire)
    7680            return;
     81        glTranslatef(0,0,0.1f);
    7782        glColor3fv(pixelContourColour);//0.0f,0.0f,0.0f);
    7883        for (int i=0;i<ACTUAL_NUM_PIXELS;i++)
     
    190195                 }
    191196         glEnd();
     197         glTranslatef(0,0,0.1f);
    192198
    193199         glColor3fv(highlightedPatchesCoulour);
     
    229235        }
    230236        int face = PixelAtPosition(cEvent->pos());
     237        cout << face << endl;
    231238        if (face != -1) {
    232239            fWhite = face;
Note: See TracChangeset for help on using the changeset viewer.