|
楼主 |
发表于 2010-4-20 11:55:37
|
显示全部楼层
alessili:
我的代码是这样的:
.....(其他方向键)
else if(ea.getKey() == GUIEventAdapter::KEY_Right )//右转
{
osg::Matrixd curMatrix = getMatrix();
osg::Matrixd transformMat;
transformMat.makeRotate( -0.1 , osg::Vec3(0.0,1.0,0.0));
setByMatrix(curMatrix*transformMat);
}
else if( ea.getKey() == GUIEventAdapter::KEY_Up )//抬头
{
osg::Matrixd curMatrix = getMatrix();
osg::Matrixd transformMat;
transformMat.makeRotate( 0.1 , osg::Vec3(1.0,0.0,0.0));
setByMatrix(transformMat*curMatrix);
}
.....(其他方向键)
每次只是按下一个键。你的这个代码好像不适合 |
|