rem: cout << q << endl; cout << v << endl;
context: void key(unsigned char key, int x, int y){    switch ( key )    {        case 27:    osgExit(); exit(0);        case 'a':   glDisable( GL_LIGHTING );            cerr << "Lighting disabled." << endl;            break;        case 's':   glEnable( GL_LIGHTING );            cerr << "Lighting enabled." << endl;            break;        case 'z':   glPolygonMode( GL_FRONT_AND_BACK, GL_POINT);            cerr << "PolygonMode: Point." << endl;            break;        case 'x':   glPolygonMode( GL_FRONT_AND_BACK, GL_LINE);            cerr << "PolygonMode: Line." << endl;            break;        case 'c':   glPolygonMode( GL_FRONT_AND_BACK, GL_FILL);            cerr << "PolygonMode: Fill." << endl;            break;        case 'r':           {            cerr << "Sending ray through " << x << "," << y << endl;            Line l;            cam->calcViewRay( l, x, y, *vp );            cerr << "From " << l.getPosition() << ", dir " << l.getDirection()                 << endl;        }        break;        case ' ':        {            Matrix     m;            Quaternion q;            Vec3f      v;            q = oldq;            v = oldv;            oldq = tball.getRotation();            oldv = tball.getPosition();            move_obj = ! move_obj;            if ( move_obj )            {                puts("moving object");//                m = scene_trans->getSFMatrix()->getValue();                tball.setMode( osg::Trackball::OSGCamera );            }            else            {                puts("moving camera");//                m = cam_trans->getSFMatrix()->getValue();                tball.setMode( osg::Trackball::OSGObject );            }            //            q.setValue(m);            tball.setStartPosition( v, true );            tball.setStartRotation( q, true );            cout << q << endl;            cout << v << endl;//            cout << " " << m[3][0] << " " << m[3][1] << " " << m[3][2] << endl;                    }        break;    }}