本文整理汇总了C++中GLFrame::RotateLocalY方法的典型用法代码示例。如果您正苦于以下问题:C++ GLFrame::RotateLocalY方法的具体用法?C++ GLFrame::RotateLocalY怎么用?C++ GLFrame::RotateLocalY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLFrame
的用法示例。
在下文中一共展示了GLFrame::RotateLocalY方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SpecialKeys
void SpecialKeys(int key, int x, int y)
{
if(key == GLUT_KEY_F1)
frameCamera.MoveForward(1.0f);
if(key == GLUT_KEY_F2)
frameCamera.MoveForward(-1.0f);
if(key == GLUT_KEY_DOWN)
frameCamera.RotateLocalX(0.01f);
if(key == GLUT_KEY_UP)
frameCamera.RotateLocalX(-0.01f);
if(key == GLUT_KEY_LEFT)
frameCamera.RotateLocalY(0.01f);
if(key == GLUT_KEY_RIGHT)
frameCamera.RotateLocalY(-0.01f);
/*if(key == GLUT_KEY_UP)
xRot-= 5.0f;
if(key == GLUT_KEY_DOWN)
xRot += 5.0f;
if(key == GLUT_KEY_LEFT)
yRot -= 5.0f;
if(key == GLUT_KEY_RIGHT)
yRot += 5.0f;
if(key > 356.0f)
xRot = 0.0f;
if(key < -1.0f)
xRot = 355.0f;
if(key > 356.0f)
yRot = 0.0f;
if(key < -1.0f)
yRot = 355.0f;*/
// Refresh the Window
glutPostRedisplay();
}
示例2: SpecialKeys
// Respond to arrow keys by moving the camera frame of reference
void SpecialKeys(int key, int x, int y)
{
if(key == GLUT_KEY_UP)
viewFrame.MoveForward(0.1f);
if(key == GLUT_KEY_DOWN)
viewFrame.MoveForward(-0.1f);
if(key == GLUT_KEY_LEFT)
viewFrame.RotateLocalY(0.1);
if(key == GLUT_KEY_RIGHT)
viewFrame.RotateLocalY(-0.1);
// Refresh the Window
glutPostRedisplay();
}
示例3: SpecialKey
void SpecialKey(int value, int x, int y)
{
if (value == GLUT_KEY_UP)
{
cameraPos[2] += 5.5f;
}
if (value == GLUT_KEY_DOWN)
{
cameraPos[2] -= 5.5f;
}
if (value == GLUT_KEY_LEFT)
{
camera.RotateLocalY(0.5f);
}
if (value == GLUT_KEY_RIGHT)
{
camera.RotateLocalY(-0.5f);
}
glutPostRedisplay();
}