Ejemplo n.º 1
0
void
motion(int x, int y)
{
/*  Real32 w = win->getWidth(), h = win->getHeight();


    Real32  a = 2. * ( lastx / w - .5 ),
                b = 2. * ( .5 - lasty / h ),
                c = 2. * ( x / w - .5 ),
                d = 2. * ( .5 - y / h );

    if ( mouseb & ( 1 << GLUT_LEFT_BUTTON ) )
    {
        tball.updateRotation( a, b, c, d );
    }
    else if ( mouseb & ( 1 << GLUT_MIDDLE_BUTTON ) )
    {
        tball.updatePosition( a, b, c, d );
    }
    else if ( mouseb & ( 1 << GLUT_RIGHT_BUTTON ) )
    {
        tball.updatePositionNeg( a, b, c, d );
    }*/
    lastx = x;
    lasty = y;

    if ( buttonPressed ) trackball.moveTo(x,y);


}