Ignore:
Timestamp:
Jun 17, 2015, 1:41:03 PM (9 years ago)
Author:
ldelgass
Message:

Merge changes to OrientationIndicator? from nanovis release branch: retains
labels on axes using GLUT in ifdef-ed blocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nanovis/trunk/OrientationIndicator.cpp

    r3630 r5719  
    66 */
    77
     8#define USE_GLUT
     9
    810#include <GL/glew.h>
    911#include <GL/gl.h>
    1012#include <GL/glu.h>
     13#ifdef USE_GLUT
     14#include <GL/glut.h>
     15#endif
    1116
    1217#include <vrmath/Vector3f.h>
     
    106111            gluCylinder(qobj, 0.02, 0.0, 0.06, segments, 1);
    107112            glPopMatrix();
     113
     114#ifdef USE_GLUT
     115            glDisable(GL_LIGHTING);
     116            glPushMatrix();
     117            glTranslatef(0.4, 0., 0.);
     118            glRotatef(90, 1, 0, 0);
     119            glRotatef(180, 0, 1, 0);
     120            glScalef(0.0005, 0.0005, 0.0005);
     121            glutStrokeCharacter(GLUT_STROKE_ROMAN, 'x');
     122            glPopMatrix();
     123            glEnable(GL_LIGHTING);
     124#endif
    108125        }
    109126
     
    121138            gluCylinder(qobj, 0.02, 0.0, 0.06, segments, 1);
    122139            glPopMatrix();
     140
     141#ifdef USE_GLUT
     142            glDisable(GL_LIGHTING);
     143            glPushMatrix();
     144            glTranslatef(0., 0.4, 0.);
     145            glRotatef(90, 1, 0, 0);
     146            glRotatef(180, 0, 1, 0);
     147            glScalef(0.0005, 0.0005, 0.0005);
     148            glutStrokeCharacter(GLUT_STROKE_ROMAN, 'y');
     149            glPopMatrix();
     150            glEnable(GL_LIGHTING);
     151#endif
    123152        }
    124153
     
    134163            gluCylinder(qobj, 0.02, 0.0, 0.06, segments, 1);
    135164            glPopMatrix();
     165
     166#ifdef USE_GLUT
     167            glDisable(GL_LIGHTING);
     168            glPushMatrix();
     169            glTranslatef(0., 0., 0.4);
     170            glRotatef(90, 1, 0, 0);
     171            glRotatef(180, 0, 1, 0);
     172            glScalef(0.0005, 0.0005, 0.0005);
     173            glutStrokeCharacter(GLUT_STROKE_ROMAN, 'z');
     174            glPopMatrix();
     175            glEnable(GL_LIGHTING);
     176#endif
    136177        }
    137178    }
Note: See TracChangeset for help on using the changeset viewer.