当前位置: 首页>>代码示例>>C++>>正文


C++ CoordinatesExtractor类代码示例

本文整理汇总了C++中CoordinatesExtractor的典型用法代码示例。如果您正苦于以下问题:C++ CoordinatesExtractor类的具体用法?C++ CoordinatesExtractor怎么用?C++ CoordinatesExtractor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CoordinatesExtractor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initCalibration

void initCalibration()
{
// Now wind the input points file while the head calibration isn't done
    while ( true )
    {   // Here we load the variables needed to keep track of the experiment status
        readline(inputStream, trialNumber,  headCalibration,  trialMode, pointMatrix );
        //First phase of calibration (equivalent when spacebar is pressed first time )
        if ( (headCalibration== 1) && (headCalibrationDone==0 ))
        {   headEyeCoords.init(pointMatrix.col(3),pointMatrix.col(4), pointMatrix.col(0),pointMatrix.col(1),pointMatrix.col(2),interoculardistance );
            headCalibrationDone=headCalibration;
            //cerr << headCalibrationDone << endl;
        }
        // Second phase of calibration (equivalent when space bar is pressed second time )
        if ( (headCalibration== 2) && (headCalibrationDone==1 ))
        {   headEyeCoords.init( headEyeCoords.getP1(),headEyeCoords.getP2(), pointMatrix.col(0),pointMatrix.col(1),pointMatrix.col(2),interoculardistance );
            eyeCalibration=headEyeCoords.getRightEye();
            headCalibrationDone=headCalibration;
        }
        // Third and final phase of calibration ( equivalent when spacebar is pressed third time )
        if ((headCalibration==3))
        {   headEyeCoords.init( headEyeCoords.getP1(),headEyeCoords.getP2(), pointMatrix.col(0),pointMatrix.col(1),pointMatrix.col(2),interoculardistance );
            eyeCalibration=headEyeCoords.getRightEye();
            headCalibrationDone=3;
            break; // exit the while cycle
        }
        // simulates the update of head and eyes positions
        if ( headCalibration==headCalibrationDone)
            headEyeCoords.update(pointMatrix.col(0),pointMatrix.col(1),pointMatrix.col(2));
    }
}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例2: paintGL

/**
 * @brief paintGL
 */
void paintGL()
{
    if (stereo)
    {   glDrawBuffer(GL_BACK);
        // Draw left eye view
        glDrawBuffer(GL_BACK_LEFT);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glClearColor(0.0,0.0,0.0,1.0);
        cam.setEye(headEyeCoords.getRightEye());
        drawInfo();
        drawTrial();
        // Draw right eye view
        glDrawBuffer(GL_BACK_RIGHT);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glClearColor(0.0,0.0,0.0,1.0);
        cam.setEye(headEyeCoords.getLeftEye());
        drawInfo();
        drawTrial();
        glutSwapBuffers();
    }
    else
    {
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glClearColor(0.0,0.0,0.0,1.0);
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity();
        cam.setEye(headEyeCoords.getRightEye());
        drawInfo();
        drawTrial();
        glutSwapBuffers();
    }
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例3: handleKeypress

void handleKeypress(unsigned char key, int x, int y)
{   switch (key)
    {   //Quit program
    case 'q':
    case 27:
    {   cleanup();
        exit(0);
    }
    break;
    case 'i':
        interoculardistance+=1;
        headEyeCoords.setInterOcularDistance(interoculardistance);
        break;
    case 'I':
        interoculardistance-=1;
        headEyeCoords.setInterOcularDistance(interoculardistance);
        break;
    case 'w':
        modelZ-=1;
        break;
    case 's':
        modelZ+=1;
        break;
    }
}
开发者ID:guendas,项目名称:cncsvision,代码行数:25,代码来源:demoBuddha.cpp

示例4: initVariables

void initVariables()
{
    totalTimer.start();
    interoculardistance = str2num<double>(parameters.find("IOD"));
    trial.init(parameters);
    factors = trial.getNext(); // Initialize the factors in order to start from trial 1

    useCircularMask = util::str2num<int>( parameters.find("CircularMask")) == 1 ;
    circularMaskRadius = util::str2num<int>(parameters.find("CircularMaskRadius"));
    if (useCircularMask)
        glEnable(GL_STENCIL_TEST);
    else
        glDisable(GL_STENCIL_TEST);

    fixationDurationInSeconds = util::str2num<double>(parameters.find("AdaptationDurationInSeconds"));
    // Imposta stimolo e drawer
    redDotsPlane.setNpoints(util::str2num<int>(parameters.find("NumStimulusPoints")));
    redDotsPlane.setDimensions(
        util::str2num<int>(parameters.find("StimulusEdgeLength")),
        util::str2num<int>(parameters.find("StimulusEdgeLength")),0.1);
    redDotsPlane.compute();
    stimDrawer.initList(&redDotsPlane,glRed);

    resetPointStrip();

    stimulusDurationInMilliSeconds = util::str2num<double>(parameters.find("StimulusDuration"));
    initialAdaptationTimeInSeconds = util::str2num<double>(parameters.find("InitialAdaptationTime"));
    initialAdaptationFlowIncrement = util::str2num<double>(parameters.find("InitialAdaptationFlowIncrement"));
    stimMotion=SINUSOIDAL_MOTION;
    trialMode = INITIALADAPTATION;

    headEyeCoords.init(Vector3d(interoculardistance/2,0,0),Vector3d(interoculardistance/2,0,0), Vector3d(0,0,0),Vector3d(0,10,0),Vector3d(0,0,10),interoculardistance );
    eyeCalibration=headEyeCoords.getRightEye();
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例5: handleKeypress

void handleKeypress(unsigned char key, int x, int y)
{   switch (key)
    {       //Quit program
        case 'q':
        case 27:
        {   cleanup();
            exit(0);
        }
        break;
        case ' ':
        {   // Here we record the head shape - coordinates of eyes and markers, but centered in (0,0,0)
            if ( headCalibrationDone==0 && allVisibleHead )
            {   headEyeCoords.init(markers.at(17).p,markers.at(18).p, markers.at(1).p,markers.at(2).p,markers.at(3).p,interoculardistance );
                headCalibrationDone=1;
                beepOk();
            }
            break;
        }
        break;
        case 13:
            whichColor=(bool)(rand()%2);
        break;

        case 'f':
        case 'F':
        {   // Here we record the finger tip physical markers
            if ( allVisiblePlatform && (fingerCalibrationDone==0) )
            {   platformIndex=markers.at(16).p;
                platformThumb=markers.at(15).p;
                fingerCalibrationDone=1;
                beepOk();
                break;
            }
            if ( (fingerCalibrationDone==1) && allVisibleFingers )
            {   thumbCoords.init(platformThumb, markers.at(11).p, markers.at(12).p, markers.at(13).p);
                indexCoords.init(platformIndex, markers.at(7).p, markers.at(8).p, markers.at(9).p );
                fingerCalibrationDone=3;
                beepOk();
                RoveretoMotorFunctions::homeObjectAsynchronous(3500);
                break;
            }	
        }
        break;
        case '+':
            {
            mirrorAngle+=10;
            mirrorPlane = Eigen::Hyperplane<double,3>(Vector3d(sin(toRadians(mirrorAngle)),0,cos(toRadians(mirrorAngle))),focalDistance);
            cout << mirrorAngle << endl;
            }
            break;
        case '-':
            {
            mirrorAngle-=10;
            mirrorPlane = Eigen::Hyperplane<double,3>(Vector3d(sin(toRadians(mirrorAngle)),0,cos(toRadians(mirrorAngle))),focalDistance);
            cout << mirrorAngle << endl;
            }
            break;
    }
}
开发者ID:,项目名称:,代码行数:59,代码来源:

示例6: update

void update(int value)
{   markers = optotrak.getAllMarkers();
    headEyeCoords.update(markers[1].p,markers[2].p,markers[3].p);

    eyeLeft = headEyeCoords.getLeftEye();
    eyeRight = headEyeCoords.getRightEye();

    glutPostRedisplay();
    glutTimerFunc(TIMER_MS, update, 0);
}
开发者ID:guendas,项目名称:cncsvision,代码行数:10,代码来源:demoBuddha.cpp

示例7: online_fingers

/*** Online operations ***/
void online_fingers()
{
    allVisibleReferenceMarkers = isVisible(markers.at(calibration1).p) && isVisible(markers.at(calibration2).p) && isVisible(markers.at(calibration3).p) && isVisible(markers.at(calibration4).p);
    
    allVisibleIndex = isVisible(markers.at(ind1).p) && isVisible(markers.at(ind2).p) && isVisible(markers.at(ind3).p);
    allVisibleThumb = isVisible(markers.at(thu1).p) && isVisible(markers.at(thu2).p) && isVisible(markers.at(thu3).p);
    allVisibleFingers = allVisibleIndex && allVisibleThumb;

    allVisibleCalibrationMarkers = isVisible(markers.at(indexcal).p) && isVisible(markers.at(thumbcal).p);

    if(allVisibleCalibrationMarkers && fingerCalibrationDone == 0)
        fingerCalibrationDone = 1;

        // fingers coordinates, fingersOccluded and framesOccluded
    if ( fingerCalibrationDone >= 3)
    {
        if(allVisibleIndex)
        {
            indexCoords.update(markers.at(ind1).p, markers.at(ind2).p, markers.at(ind3).p );
            #ifndef SIMULATION
                ind = indexCoords.getP1();
            #endif
        }

        if(allVisibleThumb)
        {
            thumbCoords.update(markers.at(thu1).p, markers.at(thu2).p, markers.at(thu3).p );
            #ifndef SIMULATION
                thu = thumbCoords.getP1();
            #endif
        }
    }

        // what the program checks online during the grasp
    if (fingerCalibrationDone==5 )
    {
        if(experiment)
        {
            // Write to responseFile
            markersFile << fixed <<
                parameters.find("SubjectName") << "\t" <<
                trialNumber << "\t" <<
                timer.getElapsedTimeInMilliSec() << "\t" <<				//time
                frameN << "\t" <<										//frameN
                ind.transpose() << "\t" <<					//indexXraw, indexYraw, indexZraw
                thu.transpose() << "\t" <<					//thumbXraw, thumbYraw, thumbZraw
                fingersOccluded	<< "\t" <<						//fingersOccluded
                framesOccluded	<< "\t" <<					//framesOccluded
                iGrasped <<
                endl;
        }
    }
}
开发者ID:,项目名称:,代码行数:54,代码来源:

示例8: calibration_head

void calibration_head(int phase)
{
    switch (phase)
    {
    case 1:
        {
            headEyeCoords.init(markers[3].p-Vector3d(70,0,0),markers[3].p, markers[10].p,markers[11].p,markers[12].p,interoculardistance );

        } break;
    case 2:
        {
            headEyeCoords.init( headEyeCoords.getP1(),headEyeCoords.getP2(), markers[10].p, markers[11].p,markers[12].p,interoculardistance );
        } break;
    }
}
开发者ID:guendas,项目名称:cncsvision,代码行数:15,代码来源:spring15-calibration-oneFpress.cpp

示例9: idle

/**
 * @brief idle
 */
void idle()
{
    // Update markers
    optotrak.updateMarkers();
    markers = optotrak.getAllMarkers();
    allVisiblePatch = isVisible(markers[1].p) && isVisible(markers[2].p) && isVisible(markers[3].p); 
    allVisibleHead = isVisible(markers[17].p) && isVisible(markers[18].p) && allVisiblePatch;
    headEyeCoords.update(markers.at(1).p,markers.at(2).p,markers.at(3).p);

    if ( trialTimer.getElapsedTimeInMilliSec() >= parameters.get("WaitTime") && trialMode==BLACK_MODE )
    {
        frame=0.0;
        trialMode++;
        trialTimer.start();
    }

    if ( trialTimer.getElapsedTimeInMilliSec() >= parameters.get("ProbeTime") && trialMode==PROBE_MODE )
    {
        frame=0.0;
        trialMode++;
        trialTimer.start();
    }

    if ( trialTimer.getElapsedTimeInMilliSec() >= parameters.get("StimulusTime") && trialMode==STIMULUS_MODE )
    {
        Beep(660,660);
        frame=0.0;
        trialMode=RESPONSE_MODE;
        trialTimer.start();
    }

    markersFile << fixed << trialNumber << " " << headCalibrationDone << " " << trialMode << " " ;
    markersFile << setprecision(3) << 
        ( isVisible(markers[1].p) ? markers[1].p.transpose() : junk ) << " " <<
        ( isVisible(markers[2].p) ? markers[2].p.transpose() : junk ) << " " <<
        ( isVisible(markers[3].p) ? markers[3].p.transpose() : junk ) << " " <<
        ( isVisible(markers[17].p) ? markers[17].p.transpose() : junk ) << " " <<
        ( isVisible(markers[18].p) ? markers[18].p.transpose() : junk ) << " " <<
        ( isVisible(markers[18].p) ? markers[18].p.transpose() : junk ) << " " <<
        ( isVisible(headEyeCoords.getLeftEye()) ? headEyeCoords.getLeftEye().transpose() : junk ) << " " <<
        ( isVisible(headEyeCoords.getRightEye()) ? headEyeCoords.getRightEye().transpose() : junk ) << " " ;
    markersFile << setprecision(1) <<
                trial.getCurrent().at("ZWidth") << " " <<
                trial.getCurrent().at("Slant") << " " <<
                trial.getCurrent().at("Tilt") << " " <<
                trial.getCurrent().at("StimulusAnchored") << " " <<
                endl;
}
开发者ID:,项目名称:,代码行数:51,代码来源:

示例10: drawCube

/*** FUNCTIONS FOR TRIAL MODE DRAWING ***/
void drawCube()
{
    glColor3fv(glGreen50);
    glPushMatrix();
    glLoadIdentity();
    glTranslated(projPointEyeRight.x(), projPointEyeRight.y(), projPointEyeRight.z());
    glutWireCube(20);
    glPopMatrix();


    // YELLOW CUBE :
    // Fixed in 0,0,-418.5 in active, moving in passive
    glColor3fv(glYellow);
    glPushMatrix();
    glLoadIdentity();
    glTranslated(0,0,focalDistance);
    glutWireCube(20);
    glPopMatrix();

    // BLUE CUBE:
    // Moving in active, following the eye projection, fixed but rotating in passive
    glColor3fv(glBlue);
    Affine3d passive = (headEyeCoords.getRigidStart().getFullTransformation())*Translation3d(Vector3d(0,0,focalDistance)-eyeCalibration);
    Vector3d cubePassive = passive*Vector3d(0,0,0);
    glPushMatrix();
    glLoadIdentity();
    glTranslated(cubePassive.x(),cubePassive.y(), cubePassive.z());
    glutWireCube(20);
    glPopMatrix();
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例11: drawInfo

void drawInfo()
{
    glPushMatrix();
    glClearColor(0.0,0.0,0.0,1.0);
    glMatrixMode (GL_PROJECTION);
    glPushMatrix ();
    glLoadIdentity ();
    gluOrtho2D(0, SCREEN_WIDTH, 0, SCREEN_HEIGHT);
    glMatrixMode (GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();

    markers = optotrak.getAllPoints();

    switch ( headCalibrationDone )
    {
    case 0:
    {   allVisibleHead = isVisible(markers[17]) && isVisible(markers[18]) && isVisible(markers[1]) && isVisible(markers[2]) && isVisible(markers[3]) ;
        if ( allVisibleHead )
            glClearColor(0.0,1.0,0.0,1.0); //green light
        else
            glClearColor(1.0,0.0,0.0,1.0); //red light
    }
    break;
    case 1:
    case 2:
        //case 3:
    {
        glPrintText(10, SCREEN_HEIGHT-40,SCREEN_WIDTH,SCREEN_HEIGHT, "EL  " + stringify<int>(eyeLeft.x() ) + " " + stringify<int>(eyeLeft.y() ) + " " + stringify<int>(eyeLeft.z()) );
        glPrintText(10, SCREEN_HEIGHT-60,SCREEN_WIDTH,SCREEN_HEIGHT, "ER " + stringify<int>(eyeRight.x() ) + " " + stringify<int>(eyeRight.y() ) + " " + stringify<int>(eyeRight.z()) );
        glPrintText(10, SCREEN_HEIGHT-80,SCREEN_WIDTH,SCREEN_HEIGHT, "EC" + stringify<int>(cyclopeanEye.x())+" " + stringify<int>(cyclopeanEye.y())+" " + stringify<int>(cyclopeanEye.z()));
        glPrintText(10, SCREEN_HEIGHT-100,SCREEN_WIDTH,SCREEN_HEIGHT, "Dist " + stringify<int>(cyclopeanEye.z()-focalDistance));
        glPrintText(10, SCREEN_HEIGHT-120,SCREEN_WIDTH,SCREEN_HEIGHT, "PITCH " + stringify<int>(toDegrees(eulerAngles.getPitch())));
        glPrintText(10, SCREEN_HEIGHT-140,SCREEN_WIDTH,SCREEN_HEIGHT, "YAW " + stringify<int>(toDegrees(eulerAngles.getYaw())));
        glPrintText(10, SCREEN_HEIGHT-160,SCREEN_WIDTH,SCREEN_HEIGHT, "ROLL " + stringify<int>(toDegrees(eulerAngles.getRoll())));
        glPrintText(10, SCREEN_HEIGHT-180,SCREEN_WIDTH,SCREEN_HEIGHT, "Press SPACEBAR to calibrate again or ENTER to confirm calibration.");
        glPrintText(10, SCREEN_HEIGHT-200,SCREEN_WIDTH,SCREEN_HEIGHT, "Delta " + stringify<int>(eyeRight.z()- eyeCalibration.z()));
        Vector3d angles = headEyeCoords.getRigidStart().getFullTransformation().rotation().eulerAngles(0,1,2);

        glPrintText(10, SCREEN_HEIGHT-220,SCREEN_WIDTH,SCREEN_HEIGHT, "YAW " + stringify<int>(toDegrees(eulerAngles.getYaw())));
        glPrintText(10, SCREEN_HEIGHT-240,SCREEN_WIDTH,SCREEN_HEIGHT, "PITCH " + stringify<int>(toDegrees(eulerAngles.getPitch())));
        if ( !passiveMode )
            glPrintText(10, SCREEN_HEIGHT-260,SCREEN_WIDTH,SCREEN_HEIGHT, "Active");
        else
            glPrintText(10, SCREEN_HEIGHT-260,SCREEN_WIDTH,SCREEN_HEIGHT, "Passive");
        glPrintText(10, SCREEN_HEIGHT-280,SCREEN_WIDTH,SCREEN_HEIGHT, "OBJ " + stringify<int>(projPointEyeRight.x() ) + " " + stringify<int>(projPointEyeRight.y() ) + " " + stringify<int>(projPointEyeRight.z()) );
        glPrintText(10, SCREEN_HEIGHT-300,SCREEN_WIDTH,SCREEN_HEIGHT,"Slant= " + stringify<int>(factors["Slant"]) + " " + stringify<int>((instantPlaneSlant)));
        glPrintText(10, SCREEN_HEIGHT-320,SCREEN_WIDTH,SCREEN_HEIGHT, "GlassesL" + stringify<int>(markers[17].x() ) + " " + stringify<int>(markers[17].y() ) + " " + stringify<int>(markers[17].z()) );
        glPrintText(10, SCREEN_HEIGHT-340,SCREEN_WIDTH,SCREEN_HEIGHT, "GlassesR" + stringify<int>(markers[18].x() ) + " " + stringify<int>(markers[18].y() ) + " " + stringify<int>(markers[18].z()) );
    }
    break;
    }

    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    glMatrixMode(GL_MODELVIEW);
    glPopMatrix();
    glPopMatrix();
    // end if ( headCalibrationDone )
}
开发者ID:,项目名称:,代码行数:60,代码来源:

示例12: idle

void idle()
{
Timer frameTimer; frameTimer.start();
    // Timing things
    timeFrame+=1;

    double oscillationPeriod = factors.at("StimulusDuration")*TIMER_MS;

    switch (stimMotion)
    {
    case SAWTOOTH_MOTION:
        periodicValue = oscillationAmplitude*mathcommon::sawtooth(timeFrame,oscillationPeriod);
        break;
    case TRIANGLE_MOTION:
        periodicValue = oscillationAmplitude*mathcommon::trianglewave(timeFrame,oscillationPeriod);
        break;
    case SINUSOIDAL_MOTION:
        periodicValue = oscillationAmplitude*sin(3.14*timeFrame/(oscillationPeriod));
        break;
    default:
        SAWTOOTH_MOTION;
    }

    timingFile << totalTimer.getElapsedTimeInMilliSec() << " " << periodicValue << endl;

    // Simulate head translation
    // Coordinates picker
    markers[1] = Vector3d(0,0,0);
    markers[2] = Vector3d(0,10,0);
    markers[3] = Vector3d(0,0,10);

    headEyeCoords.update(markers[1],markers[2],markers[3]);

    eyeLeft = headEyeCoords.getLeftEye();
    eyeRight = headEyeCoords.getRightEye();

    Vector3d fixationPoint = (headEyeCoords.getRigidStart().getFullTransformation() * ( Vector3d(0,0,focalDistance) ) );
    // Projection of view normal on the focal plane
    Eigen::ParametrizedLine<double,3> pline = Eigen::ParametrizedLine<double,3>::Through(eyeRight,fixationPoint);
    projPoint = pline.intersection(focalPlane)*((fixationPoint - eyeRight).normalized()) + eyeRight;

    stimTransformation.matrix().setIdentity();
    stimTransformation.translation() <<0,0,focalDistance;

    Timer sleepTimer;
    sleepTimer.sleep((TIMER_MS - frameTimer.getElapsedTimeInMilliSec())/2);
}
开发者ID:guendas,项目名称:cncsvision,代码行数:47,代码来源:expPointsStrip_base.cpp

示例13: calibration_fingers

/*** GRASP ***/
void calibration_fingers(int phase)
{
    switch (phase)
    {
        case 1:
        {
            index_marker = markers.at(indexcal).p;
            thumb_marker = markers.at(thumbcal).p;
        }

        case 2:
        {
            indexCoords.init(index_marker, markers.at(ind1).p, markers.at(ind2).p, markers.at(ind3).p);
            thumbCoords.init(thumb_marker, markers.at(thu1).p, markers.at(thu2).p, markers.at(thu3).p);
        } break;
    }
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例14: update

void update(int value)
{   optotrak.updatePoints();
    markers = optotrak.getAllPoints();

    headEyeCoords.update(markers[1],markers[2],markers[3]);
    modelCoordinates.update(markers[10],markers[19],markers[20]);
    if ( isVisible(markers[20]+markers[19]+markers[10]) )
    {
        rigidCurrent.setRigidBody(markers[20], markers[19],modelCoordinates.getFinger() );
        rigidAux.computeTransformation(rigidCurrent,true);	// true the scaling matrix
    }
    eyeLeft = headEyeCoords.getLeftEye();
    eyeRight = headEyeCoords.getRightEye();

    glutPostRedisplay();
    glutTimerFunc(TIMER_MS, update, 0);
}
开发者ID:,项目名称:,代码行数:17,代码来源:

示例15: drawRedDotsPlane

void drawRedDotsPlane()
{   // Draw the stimulus ( red-dots plane )
    glDisable(GL_COLOR_MATERIAL);
    glDisable(GL_BLEND);
    glDisable(GL_LIGHTING);

    // IMPORTANT Reset the previous status of transformation
    objectActiveTransformation.setIdentity();
    objectActiveTransformation.translation() = projPointEyeRight + translationFactor;
    if ((int)factors["Translation"]==-1 || (int)factors["Translation"]==-2 )
        objectActiveTransformation.linear().setIdentity();
    else
        objectActiveTransformation.linear()	= (AngleAxis<double>(eulerAngles.getYaw(), Vector3d::UnitY())*AngleAxis<double>(eulerAngles.getPitch(), Vector3d::UnitX())).toRotationMatrix();

    glPushMatrix();     // PUSH MATRIX
    glLoadIdentity();
    glMultMatrixd(objectActiveTransformation.data());

    Vector3d posAlongLineOfSight = (headEyeCoords.getRigidStart().getFullTransformation().rotation())*(eyeRight-eyeCalibration);

    double argslant = acos( cos(toRadians(factors["Slant"]))*(focalDistance-posAlongLineOfSight.z() )/((focalDistance )));
    instantPlaneSlant = toDegrees(argslant);


    switch ( (int) factors["Tilt"] )
    {
    case 0:
        glRotated( instantPlaneSlant ,0,1,0);
        //objectActiveTransformation*=AngleAxisd( toRadians(-instantPlaneSlant), Vector3d::UnitY() );
        glScaled(1/sin(toRadians( -90-factors["Slant"])),1,1);	//backprojection phase
        break;
    case 90:
        glRotated( -instantPlaneSlant ,1,0,0);
        //objectActiveTransformation*=AngleAxisd( toRadians(-instantPlaneSlant), Vector3d::UnitX() );
        glScaled(1,1/sin(toRadians( -90-factors["Slant"] )),1); //backprojection phase
        break;
    case 180:
        glRotated( -instantPlaneSlant ,0,1,0);
        //objectActiveTransformation*=AngleAxisd( toRadians(-instantPlaneSlant), Vector3d::UnitY() );
        glScaled(1/sin(toRadians( -90-factors["Slant"] )),1,1); //backprojection phase
        break;
    case 270:
        glRotated( instantPlaneSlant ,1,0,0);
        //objectActiveTransformation*=AngleAxisd( toRadians(-instantPlaneSlant), Vector3d::UnitX() );
        glScaled(1,1/sin(toRadians( -90-factors["Slant"] )),1); //backprojection phase
        break;
    }

    glGetDoublev(GL_MODELVIEW_MATRIX,objectActiveTransformation.data());
    BoundChecker stimBoundariesActive(&cam, &redDotsPlane);
    BoundChecker stimBoundariesPassive(&camPassive, &redDotsPlane);

    stimOutside = ( stimBoundariesActive.checkOutside(objectActiveTransformation) || stimBoundariesPassive.checkOutside(objectActiveTransformation));
    stimDrawer.draw();

    glPopMatrix();	// POP MATRIX

}
开发者ID:,项目名称:,代码行数:58,代码来源:


注:本文中的CoordinatesExtractor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。