本文整理汇总了C++中GLText类的典型用法代码示例。如果您正苦于以下问题:C++ GLText类的具体用法?C++ GLText怎么用?C++ GLText使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GLText类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawInfo
void drawInfo()
{
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_BLEND);
glDisable(GL_LIGHTING);
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_18);
// text.init(640,480,glWhite,GLUT_BITMAP_HELVETICA_12);
text.enterTextInputMode();
glColor3fv(glWhite);
text.draw("# stim height: ");// +stringify<double>(stimulus_height));
text.leaveTextInputMode();
}
示例2: drawStimulus
void drawStimulus()
{
if (fingerCalibrationDone==3 && checkHandAtStart && isStimulusDrawn)
{
glLoadIdentity();
// ###### draw rotated stimulus (adjusted) ######
glTranslated(0.0,0,trial.getCurrent().first["AbsDepth"] + jitter);
firstD = trial.getCurrent().second->getCurrentStaircase()->getState();
if( !allVisibleFingers && !moveToPartIV)
drawNoFingers();
if(fingersShown)
drawFingers();
if(!pause)
{
if(part == 1 && started)
{
drawLetter(condition); // draw L or P
if(moveToPartII)
part += 1;
} else if (part == 2)
{
drawCross();
if(moveToPartIII)
part += 1;
} else if (part == 3)
{
drawTrial(firstD); // draw first triple of rods
if(moveToPartIV)
part += 1;
} else if (part == 4)
{
drawBlack();
}
} else
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glRed,GLUT_BITMAP_TIMES_ROMAN_24);
text.enterTextInputMode();
for(int i=0;i<13;i++)
text.draw("");
text.draw(" BREAK");
text.leaveTextInputMode();
timer.stop();
}
glLoadIdentity();
}
}
示例3: drawCross
void drawCross()
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glRed,GLUT_BITMAP_TIMES_ROMAN_24);
text.enterTextInputMode();
for(int i=0;i<13;i++)
text.draw("");
text.draw(" +");
text.leaveTextInputMode();
}
示例4: curProtein
void RamachandranPlot::draw(void)
{
ProteinState *state = curProtein();
if ( !state ) return;
GLText text;
if(!valid())
{
/* Set the viewport: */
glViewport(0,0,w(),h());
/* Set the projection and modelview matrices: */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
float factor=1.0/Math::Constants<double>::pi;
glScale(factor,factor,factor);
glDisable(GL_DEPTH_TEST);
}
/* Clear window: */
glClearColor(backgroundColor);
glClear(GL_COLOR_BUFFER_BIT);
/* Draw ramachandran texture background: */
glEnable(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_BASE_LEVEL,0);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_LEVEL,0);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glPixelStorei(GL_UNPACK_SKIP_PIXELS,0);
glPixelStorei(GL_UNPACK_ROW_LENGTH,0);
glPixelStorei(GL_UNPACK_SKIP_ROWS,0);
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT,0);
glPixelStorei(GL_UNPACK_SKIP_IMAGES,0);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB8,ramachandranTextureHeight,ramachandranTextureWidth,0,GL_RGB,GL_UNSIGNED_BYTE,ramachandranTexture);
glColor3f(1.0f,0.0f,1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f,0.0f);
glVertex2f(-Math::Constants<float>::pi,-Math::Constants<float>::pi);
glTexCoord2f(1.0f,0.0f);
glVertex2f(Math::Constants<float>::pi,-Math::Constants<float>::pi);
glTexCoord2f(1.0f,1.0f);
glVertex2f(Math::Constants<float>::pi,Math::Constants<float>::pi);
glTexCoord2f(0.0f,1.0f);
glVertex2f(-Math::Constants<float>::pi,Math::Constants<float>::pi);
glEnd();
glDisable(GL_TEXTURE_2D);
/* Draw coordinate axes: */
glColor3f(1.0f-backgroundColor[0],1.0f-backgroundColor[1],1.0f-backgroundColor[2]);
glBegin(GL_LINES);
glVertex2f(0.0f,-4.0f);
glVertex2f(0.0f,4.0f);
glVertex2f(-4.0f,0.0f);
glVertex2f(4.0f,0.0f);
glEnd();
/* Draw axes data range */
text.setFontColor(0.0, 0.0, 0.0);
/* h, v */
/* + */
/*- +*/
/* - */
text.drawFreeString("pi",2.3f,-2.7f);
text.drawFreeString("-pi",-2.8f,-2.7f);
text.drawFreeString("pi",-3.0f,2.6f);
text.drawFreeString("0",-3.0f,-0.3f);
text.drawFreeString("0",-0.3f,-2.7f);
text.drawFreeString("Phi",0.15f,2.5f);
text.drawFreeString("Psi",2.5f,0.15f);
/* Draw axes label */
text.setFontScale(0.003, 0.003);
text.setFontColor(0.0, 0.0, 1.0);
if(structureValid)
{
/* Visualize dihedral angles inside a selected structure: */
glPointSize(3.0f);
glBegin(GL_POINTS);
glColor(selectedStructureColor);
for(int i=0;i<numStructureResidues;++i)
glVertex(structurePhis[i],structurePsis[i]);
glEnd();
}
/* Visualize dihedral angles inside all active coil regions: */
if(activeCoilsValid)
{
/* Visualize dihedral angles inside all active coil regions: */
glPointSize(3.0f);
glBegin(GL_POINTS);
glColor(activeCoilRegionColor);
for(int i=0;i<numActiveCoilsResidues;++i)
//.........这里部分代码省略.........
示例5: drawLetter
void drawLetter(int letter)
{
if (letter <= 0) // vision (L)
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glRed,GLUT_BITMAP_TIMES_ROMAN_24);
text.enterTextInputMode();
for(int i=0;i<13;i++)
text.draw("");
text.draw(" L");
text.leaveTextInputMode();
} else // pointing
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glRed,GLUT_BITMAP_TIMES_ROMAN_24);
text.enterTextInputMode();
for(int i=0;i<13;i++)
text.draw("");
text.draw(" P");
text.leaveTextInputMode();
}
}
示例6: drawInfo
void drawInfo()
{
if ( visibleInfo )
{
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_BLEND);
glDisable(GL_LIGHTING);
GLText text;
if ( gameMode )
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_18);
else
text.init(640,480,glWhite,GLUT_BITMAP_HELVETICA_12);
text.enterTextInputMode();
switch ( headCalibrationDone )
{
case 0:
{
if ( allVisibleHead )
text.draw("==== Head Calibration OK ==== Press Spacebar to continue");
else
text.draw("Be visible with the head and glasses");
}
break;
case 1:
case 2:
{
if ( allVisiblePatch )
text.draw("Move the head in the center");
else
text.draw("Be visible with the patch");
}
break;
case 3: // When the head calibration is done then calibrate the fingers
{
switch ( fingerCalibrationDone )
{
case 0:
text.draw("Press F to record platform markers");
break;
case 1:
text.draw("Move index and thumb on platform markers to record ghost finger tips, then press F");
break;
case 2:
text.draw("Move index and thumb to rigidbody tip to define starting position, then press F");
break;
case 3:
text.draw("Finger calibration successfull!");
break;
}
}
break;
}
if ((GetKeyState(VK_CAPITAL) & 0x0001)!=0)
{
text.draw("#");
text.draw("#");
text.draw("# ----------------------------> Caps Lock ON!");
text.draw("#");
text.draw("#");
}
text.draw("####### SUBJECT #######");
text.draw("#");
text.draw("# Name: " +parameters.find("SubjectName"));
text.draw("# IOD: " +stringify<double>(interoculardistance));
text.draw("#");
if ( abs(mirrorAlignment - 45.0) < 0.2 )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("# Mirror Alignment = " + stringify<double>(mirrorAlignment));
glColor3fv(glWhite);
text.draw("#");
text.draw("#######################");
text.draw("HeadCalibration= " + stringify<int>(headCalibrationDone) );
text.draw("FingerCalibration= " + stringify<int>(fingerCalibrationDone) );
glColor3fv(glWhite);
text.draw("Calibration Platform" );
if ( isVisible(markers[1].p) && isVisible(markers[2].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Marker "+ stringify<int>(1)+stringify< Eigen::Matrix<double,1,3> > (markers[1].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(2)+stringify< Eigen::Matrix<double,1,3> > (markers[2].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(4)+stringify< Eigen::Matrix<double,1,3> > (markers[4].p.transpose())+ " [mm]" );
glColor3fv(glWhite);
text.draw("Marker "+ stringify<int>(3)+stringify< Eigen::Matrix<double,1,3> > (markers[3].p.transpose())+ " [mm]" );
glColor3fv(glWhite);
text.draw(" " );
text.draw("Mirror" );
if ( isVisible(markers[5].p) && isVisible(markers[6].p) && isVisible(markers[7].p) )
//.........这里部分代码省略.........
示例7: drawInfo
void drawInfo()
{
if ( visibleInfo )
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
text.enterTextInputMode();
text.draw("####### SUBJECT #######");
text.draw("#");
text.draw("# Name: " +parameters.find("SubjectName"));
text.draw("# IOD: " +stringify<double>(interoculardistance));
text.draw("#");
text.draw("# trial: " +stringify<double>(trialNumber));
text.draw("#");
text.draw("#######################");
text.draw(" ");
text.draw(" ");
text.draw("Press ENTER to start.");
text.leaveTextInputMode();
}
if ( expFinished )
{
GLText text2;
text2.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
text2.enterTextInputMode();
text2.draw("The experiment is finished.");
text2.leaveTextInputMode();
}
}
示例8: drawInfo
void drawInfo()
{
if ( !infoDrawn )
return;
GLText text;
text.init(SCREEN_WIDTH, SCREEN_HEIGHT,glWhite);
text.enterTextInputMode();
string strfactors;
for ( map<string,double>::iterator iter = factors.begin(); iter!=factors.end(); ++iter)
{
text.draw( (iter->first) + "= " + util::stringify<int>( (int )(iter->second)) );
}
switch ( headCalibrationDone )
{
case 0:
{
if ( allVisibleHead )
text.draw("OK! Press SPACEBAR");
else
text.draw("---");
}
break;
case 1:
case 2:
{
text.draw( "EL " + stringify<int>(eyeLeft.x() ) + " " + stringify<int>(eyeLeft.y() ) + " " + stringify<int>(eyeLeft.z()) );
text.draw( "ER " + stringify<int>(eyeRight.x() ) + " " + stringify<int>(eyeRight.y() ) + " " + stringify<int>(eyeRight.z()) );
text.draw("EC " + stringify<int>(cyclopeanEye.x())+" " + stringify<int>(cyclopeanEye.y())+" " + stringify<int>(cyclopeanEye.z()));
text.draw("Dist " + stringify<int>(cyclopeanEye.z()-focalDistance+60.0));
text.draw(" ");
text.draw( "PITCH " + stringify<int>(toDegrees(headEyeCoords.getPitch())));
text.draw( "YAW " + stringify<int>(toDegrees(headEyeCoords.getYaw())));
text.draw( "ROLL " + stringify<int>(toDegrees(headEyeCoords.getRoll())));
}
break;
}
text.leaveTextInputMode();
}
示例9: drawInfo
// Provide text instructions for calibration, as well as information about status of experiment
void drawInfo()
{
if (finished)
visibleInfo = true;
if ( visibleInfo )
{
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_BLEND);
glDisable(GL_LIGHTING);
GLText text;
if ( gameMode )
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_18);
else
text.init(640,480,glWhite,GLUT_BITMAP_HELVETICA_12);
text.enterTextInputMode();
if (finished) {
glColor3fv(glWhite);
text.draw("The experiment is over. Thank you! :)");
}else{
switch (fingerCalibration)
{
case 0:
text.draw("Expose three and upper pin");
break;
case 1:
text.draw("Expose three and lower pin");
break;
case 2:
text.draw("Grasp the pins, expose three and posts, press F");
break;
case 3:
text.draw("Place hand in start position, then press F");
break;
case 4:
text.draw("Touch the position of the left object with your index finger, then press F");
break;
case 5:
text.draw("Touch the position of the right object with your index finger, then press F");
break;
case 6:
text.draw("Press F to begin!");
break;
} // end switch(fingerCalibration)
/////// Header ////////
text.draw("####### ####### #######");
text.draw("#");
//text.draw("# Name: " +parameters.find("SubjectName"));
text.draw("# Name: " +parameters[0].find("SubjectName"));
text.draw("# IOD: " +stringify<double>(interoculardistance));
text.draw("# Block: " +stringify<double>(block+1));
text.draw("# Trial: " +stringify<double>(trialNumber));
/////// Mirror and Screen Alignment ////////
if ( abs(mirrorAlignment - 45.0) < 0.2 )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("# Mirror Alignment = " +stringify<double>(mirrorAlignment));
if ( screenAlignmentY < 89.0 )
glColor3fv(glRed);
else
glColor3fv(glGreen);
text.draw("# Screen Alignment Y = " +stringify<double>(screenAlignmentY));
if ( abs(screenAlignmentZ) < 89.0 )
glColor3fv(glRed);
else
glColor3fv(glGreen);
text.draw("# Screen Alignment Z = " +stringify<double>(screenAlignmentZ));
/////// Finger Calibration ////////
glColor3fv(glWhite);
text.draw("#######################");
text.draw("Calibration Step= " + stringify<int>(fingerCalibration) );
glColor3fv(glWhite);
text.draw("Calibration Platform" );
if ( allVisiblePlatform3 )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Platform Three "
+stringify< Eigen::Matrix<double,1,3> > (markers[8].p.transpose())+ " [mm]\n"
+stringify< Eigen::Matrix<double,1,3> > (markers[11].p.transpose())+ " [mm]\n"
+stringify< Eigen::Matrix<double,1,3> > (markers[12].p.transpose())+ " [mm]" );
if ( isVisible(markers[1].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Index Marker " + stringify<int>(1)
+stringify< Eigen::Matrix<double,1,3> > (markers[1].p.transpose())+ " [mm]" );
if ( isVisible(markers[2].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Thumb Marker " + stringify<int>(2)
//.........这里部分代码省略.........
示例10: drawInfo
/*** INFO ***/
void drawInfo()
{
if ( visibleInfo )
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
text.enterTextInputMode();
glColor3fv(glWhite);
if(experiment)
text.draw("####### SUBJECT #######");
if(training)
text.draw("####### THIS IS JUST A TRAINING #######");
text.draw("#");
text.draw("# Name: " +parameters.find("SubjectName"));
text.draw("# IOD: " +stringify<double>(interoculardistance));
text.draw("#");
text.draw("# trial: " +stringify<double>(trialNumber));
text.draw("#");
text.draw("#######################\n\n");
text.draw(" ");
// check if mirror is calibrated
if ( abs(mirrorAlignment - 45.0) < 0.2 )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("# Mirror Alignment = " +stringify<double>(mirrorAlignment));
// check if monitor is calibrated
if ( screenAlignmentY < 89.0 )
glColor3fv(glRed);
else
glColor3fv(glGreen);
text.draw("# Screen Alignment Y = " +stringify<double>(screenAlignmentY));
if ( abs(screenAlignmentZ) < 89.4 )
glColor3fv(glRed);
else
glColor3fv(glGreen);
text.draw("# Screen Alignment Z = " +stringify<double>(screenAlignmentZ));
glColor3fv(glWhite);
// X and Z coords of simulated fixation
text.draw("# Fixation Z = " +stringify<double>(markers.at(screen1).p.x()-120.0)+ " [mm]");
text.draw("# Fixation X = " +stringify<double>(markers.at(screen1).p.z()+363.0)+ " [mm]");
text.draw(" ");
glColor3fv(glWhite);
text.draw(" " );
text.draw("time: " +stringify<int>(timer.getElapsedTimeInMilliSec()));
text.draw("experiment = " +stringify<int> (experiment));
text.draw("training = " +stringify<int> (training));
text.draw("isTrialDone = " +stringify<int> (isTrialDone));
text.draw("stimulus = " +stringify<int> (stimulus));
text.leaveTextInputMode();
}
if ( expFinished )
{
GLText text2;
text2.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
text2.enterTextInputMode();
text2.draw("The experiment is finished.");
text2.leaveTextInputMode();
}
}
示例11: drawInfo
void drawInfo()
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
text.enterTextInputMode();
text.draw("-----------LINEAR ACTUATORS-----------");
text.draw("Press 7 to toggle motors");
text.draw("Motor: " + stringify<int>(which_axis%2));
text.draw(" ");
text.draw("Press w to increase desired position, or s to decrease desired position");
text.draw("Then press 8 to move");
text.draw(" ");
text.draw("desired position = " + stringify<double>(phi_distance));
text.draw(" ");
text.draw("-----------STEPPER-----------");
text.draw("Press q to increase desired theta, or a to decrease desired theta");
text.draw("Then press 5 to move");
text.draw(" ");
text.draw("desired theta = " + stringify<double>(step_theta));
text.draw(" ");
text.leaveTextInputMode();
}
示例12: drawInfo
/*************************** FUNCTIONS ***********************************/
void drawInfo()
{
if (paused)
visibleInfo = true;
if ( visibleInfo )
{
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_BLEND);
glDisable(GL_LIGHTING);
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_18);
text.enterTextInputMode();
glColor3fv(glWhite);
text.draw("####### EXPERIMENTER INSTRUCTIONS #######");
if (!objectsForward)
{
text.draw("Press F to bring platform forward");
}
if ( objectsForward && (startPosCalibration==0) && (fingerCalibrationDone==0))
{
text.draw("Press F to record platform markers");
}
if ( objectsForward && (startPosCalibration==0) && (fingerCalibrationDone==1) )
{
text.draw("Move index and thumb on platform markers to record ghost finger tips, then press F");
}
if ( objectsForward && (startPosCalibration==0) && (fingerCalibrationDone==2) && allVisibleFingers)
{
text.draw("Move index and thumb to starting position, then press F");
}
if ( objectsForward && (startPosCalibration==1) && (fingerCalibrationDone==2))
{
text.draw("Mount the display board on the platform, then press F.");
}
if ( objectsForward && (startPosCalibration==2) && (fingerCalibrationDone==2))
{
text.draw("Press F to record position of left object (use straw).");
}
if ( objectsForward && (startPosCalibration==3) && (fingerCalibrationDone==2))
{
text.draw("Press F to record position of right object (use straw).");
}
if ( objectsForward && (startPosCalibration==4) && (fingerCalibrationDone==2) && allVisibleFingers)
{
text.draw("Press F to begin!");
}
text.draw("#########################################");
text.draw(" ");
text.draw("####### SUBJECT #######");
text.draw("#");
text.draw("# Name: " +parameters.find("SubjectName"));
text.draw("#");
text.draw("# Trial: " +stringify<int>(trialNumber));
text.draw("#");
text.draw("#######################");
text.draw("StartPosCalibration = " + stringify<int>(startPosCalibration) );
text.draw("FingerCalibration = " + stringify<int>(fingerCalibrationDone) );
text.draw(" ");
text.draw("Calibration Platform Markers" );
if ( isVisible(markers[15].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Thumb Calibration Point (15) "+stringify< Eigen::Matrix<double,1,3> >(markers[15].p.transpose())+ " [mm]" );
if ( isVisible(markers[16].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Index Calibration Point (16) "+stringify< Eigen::Matrix<double,1,3> >(markers[16].p.transpose())+ " [mm]" );
if ( isVisible(markers[10].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Straw Marker (10) "+stringify< Eigen::Matrix<double,1,3> >(markers[10].p.transpose())+ " [mm]" );
glColor3fv(glWhite);
text.draw(" ");
text.draw("Thumb" );
if ( isVisible(markers[20].p) && isVisible(markers[21].p) && isVisible(markers[22].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Marker "+ stringify<int>(20)+stringify< Eigen::Matrix<double,1,3> > (markers[20].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(21)+stringify< Eigen::Matrix<double,1,3> > (markers[21].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(22)+stringify< Eigen::Matrix<double,1,3> > (markers[22].p.transpose())+ " [mm]" );
glColor3fv(glWhite);
text.draw(" ");
text.draw("Index" );
//.........这里部分代码省略.........
示例13: drawInfo
void drawInfo()
{
if ( headCalibrationDone!=3 )
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite, GLUT_BITMAP_HELVETICA_18);
text.enterTextInputMode();
if ( passiveMode )
text.draw( "Passive" );
else
text.draw(" Active " );
if ( orthographicMode )
text.draw(" Ortho " );
else
text.draw( "Perspective " );
string row1 = stringify< Eigen::Matrix<double,1,4> >( objectPassiveTransformation.matrix().row(0) );
string row2 = stringify< Eigen::Matrix<double,1,4> >( objectPassiveTransformation.matrix().row(1) );
string row3 = stringify< Eigen::Matrix<double,1,4> >( objectPassiveTransformation.matrix().row(2) );
text.draw( row1 );
text.draw( row2 );
text.draw( row3 );
text.draw( stringify<int> (factors["Rotation"]) );
text.draw( stringify< Eigen::Vector3d >(projPointEyeRight) );
text.draw( stringify<int>(instantPlaneSlant));
text.leaveTextInputMode();
}
}
示例14: drawInfo
/**
* @brief drawInfo
*/
void drawInfo()
{ if ( infoDraw )
{ glDisable(GL_COLOR_MATERIAL);
glDisable(GL_BLEND);
glDisable(GL_LIGHTING);
GLText text;
if ( gameMode )
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_18);
else
text.init(640,480,glWhite,GLUT_BITMAP_HELVETICA_12);
text.enterTextInputMode();
text.draw("Marker5= " + stringify<Eigen::Matrix<double,1,3> >(markers.at(5).p.transpose()) );
switch ( headCalibrationDone )
{
case 0:
{ if ( allVisibleHead )
text.draw("==== Head Calibration OK ==== Press Spacebar to continue");
else
text.draw("Be visible with the head and glasses");
}
break;
case 1:
case 2:
{ if ( allVisiblePatch )
text.draw("Cyclopean(x,y,z)= " + stringify<int>((eyeRight.x()+eyeLeft.x())/2)+", "+ stringify<int>((eyeRight.y()+eyeLeft.y())/2)+", "+ stringify<int>((eyeRight.z()+eyeLeft.z())/2)+", " );
else
text.draw("Be visible with the patch");
}
break;
case 3: // When the head calibration is done then calibrate the fingers
{ switch ( fingerCalibrationDone )
{
case 0:
text.draw("Press F to record platform markers");
break;
case 1:
text.draw("Move INDEX on platform markers to record ghost finger tips, then press F");
break;
case 2:
text.draw("Move THUMB on platform markers to record ghost finger tips, then press F");
break;
case 3:
text.draw("Move BOTH INDEX AND THUMB to rigidbody tip, then press F");
break;
}
}
break;
}
if ( headCalibrationDone==3 && fingerCalibrationDone==4 )
{ text.draw("Trial mode " + stringify<int>(trialMode ));
text.draw("ThumbProjectedInside " + stringify<int>(thumbProjectedInside));
text.draw("DrawingTrialFrame= " + stringify<int>(drawingTrialFrame));
text.draw("TrialFrame= " + stringify<int>(trialFrame));
text.draw("IsDrawing?= " + stringify<int>(isDrawing));
text.draw("VisualRod= " + stringify<Eigen::Matrix<double,1,3> >(visualStimCenter.transpose()) );
text.draw("Index= " + stringify< Eigen::Matrix<double,1,3> >(indexCoords.getP1().p ));
text.draw("Thumb= " + stringify< Eigen::Matrix<double,1,3> >(thumbCoords.getP1().p ));
text.draw("GlobTime= " + stringify<int>(globalTimer.getElapsedTimeInMilliSec()));
text.draw("TrialTimer= " + stringify<int>(trialTimer.getElapsedTimeInMilliSec()));
text.draw("FingersTime= " + stringify<int>(fingersTimer.getElapsedTimeInMilliSec()));
}
//text.draw("Gain=" + stringify<double>(factors.getCurrent().at("Gain")));
text.leaveTextInputMode();
}
}
示例15: drawInfo
void drawInfo()
{
if ( visibleInfo )
{
GLText text;
text.init(SCREEN_WIDTH,SCREEN_HEIGHT,glWhite,GLUT_BITMAP_HELVETICA_12);
text.enterTextInputMode();
switch (fingerCalibrationDone)
{
case 0:
text.draw("Calibration object and index marker are not visible.");
break;
case 1:
{
glColor3fv(glGreen);
text.draw("Index marker has been detected and calibrated. Waiting for Thumb marker to be visible...");
} break;
case 2:
{
glColor3fv(glGreen);
text.draw("Index marker has been detected and calibrated.");
text.draw("Thumb marker has been detected and calibrated.");
glColor3fv(glWhite);
text.draw("Touch the two outer markers with the fingerpads then press F (fingers and calibration object visible)");
} break;
case 3:
text.draw("Set home position then press F to start the demo");
break;
}
text.draw("# IOD: " +stringify<double>(interoculardistance));
// check if mirror is calibrated
if ( abs(mirrorAlignment - 45.0) < 0.2 )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("# Mirror Alignment = " +stringify<double>(mirrorAlignment));
// check if monitor is calibrated
if ( screenAlignmentY < 89.0 )
glColor3fv(glRed);
else
glColor3fv(glGreen);
text.draw("# Screen Alignment Y = " +stringify<double>(screenAlignmentY));
if ( abs(screenAlignmentZ) < 89.0 )
glColor3fv(glRed);
else
glColor3fv(glGreen);
text.draw("# Screen Alignment Z = " +stringify<double>(screenAlignmentZ));
glColor3fv(glWhite);
// X and Z coords of simulated fixation
text.draw("# Fixation Z = " +stringify<double>(markers[19].p.x()-120.0)+ " [mm]");
text.draw("# Fixation X = " +stringify<double>(markers[19].p.z()+363.0)+ " [mm]");
text.draw(" ");
glColor3fv(glWhite);
text.draw("Calibration Platform" );
if ( isVisible(markers[1].p) && isVisible(markers[2].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Marker "+ stringify<int>(1)+stringify< Eigen::Matrix<double,1,3> > (markers[1].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(2)+stringify< Eigen::Matrix<double,1,3> > (markers[2].p.transpose())+ " [mm]" );
if ( isVisible(markers[3].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Marker "+ stringify<int>(3)+stringify< Eigen::Matrix<double,1,3> > (markers[3].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(4)+stringify< Eigen::Matrix<double,1,3> > (markers[4].p.transpose())+ " [mm]" );
glColor3fv(glWhite);
text.draw(" " );
text.draw("Index" );
if ( isVisible(markers[13].p) && isVisible(markers[14].p) && isVisible(markers[16].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Marker "+ stringify<int>(13)+stringify< Eigen::Matrix<double,1,3> > (markers[13].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(14)+stringify< Eigen::Matrix<double,1,3> > (markers[14].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(16)+stringify< Eigen::Matrix<double,1,3> > (markers[16].p.transpose())+ " [mm]" );
glColor3fv(glWhite);
text.draw(" " );
text.draw("Thumb" );
if ( isVisible(markers[15].p) && isVisible(markers[17].p) && isVisible(markers[18].p) )
glColor3fv(glGreen);
else
glColor3fv(glRed);
text.draw("Marker "+ stringify<int>(15)+stringify< Eigen::Matrix<double,1,3> > (markers[15].p.transpose())+ " [mm]" );
text.draw("Marker "+ stringify<int>(17)+stringify< Eigen::Matrix<double,1,3> > (markers[17].p.transpose())+ " [mm]" );
//.........这里部分代码省略.........