本文整理汇总了C++中Viewport::autoLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::autoLevel方法的具体用法?C++ Viewport::autoLevel怎么用?C++ Viewport::autoLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::autoLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: autoLevelTimer
void autoLevelTimer(int dummy)
{
win.autoLevel(smoothAutoLevelScale, smoothAutoLevelMaxPhi);
glutPostRedisplay();
if (smoothAutoLevel)
glutTimerFunc(smoothAutoLevelInterval, autoLevelTimer, 0);
}
示例2: keyboard
void keyboard(unsigned char key, int x, int y)
{
switch (key)
{
case 'w':
std::cout << "DOWN" << std::endl;
win.rotateAroundAxis(0, rotationDegree);
break;
case 's':
std::cout << "UP" << std::endl;
win.rotateAroundAxis(0, -rotationDegree);
break;
case 'a':
std::cout << "LEFT" << std::endl;
win.rotateAroundAxis(1, -rotationDegree);
break;
case 'd':
std::cout << "RIGHT" << std::endl;
win.rotateAroundAxis(1, rotationDegree);
break;
case 'q':
std::cout << "LEFT ROLL" << std::endl;
win.rotateAroundAxis(2, -rotationDegree);
break;
case 'e':
std::cout << "RIGHT ROLL" << std::endl;
win.rotateAroundAxis(2, rotationDegree);
break;
case 'j':
std::cout << "Moving forward." << std::endl;
win.moveAlongAxis(2, movingStep);
break;
case 'k':
std::cout << "Moving backward." << std::endl;
win.moveAlongAxis(2, -movingStep);
break;
case 'h':
std::cout << "Moving left." << std::endl;
win.moveAlongAxis(0, movingStep);
break;
case 'l':
std::cout << "Moving right." << std::endl;
win.moveAlongAxis(0, -movingStep);
break;
case 'r':
std::cout << "Reset." << std::endl;
win.reset();
break;
case 'm':
mouseLook = !mouseLook;
if (mouseLook)
{
glutSetCursor(GLUT_CURSOR_NONE);
// Init the algorithm: Warp to center
glutWarpPointer(win.w() * 0.5, win.h() * 0.5);
std::cout << "Mouse look activated." << std::endl;
}
else
{
glutSetCursor(GLUT_CURSOR_INHERIT);
std::cout << "Mouse look deactivated." << std::endl;
}
break;
case 'n':
smoothAutoLevel = !smoothAutoLevel;
if (smoothAutoLevel)
{
std::cout << "Smooth Auto-Leveling activated." << std::endl;
glutTimerFunc(smoothAutoLevelInterval, autoLevelTimer, 0);
}
else
std::cout << "Smooth Auto-Leveling deactivated." << std::endl;
break;
case 'N':
win.toggleDirectAutoLevel();
if (win.doesDirectAutoLevel())
std::cout << "Direct Auto-Leveling activated." << std::endl;
else
std::cout << "Direct Auto-Leveling deactivated." << std::endl;
break;
case 'i':
mouseInverted = !mouseInverted;
if (mouseInverted)
std::cout << "Mouse inverted." << std::endl;
else
std::cout << "Mouse not inverted." << std::endl;
break;
//.........这里部分代码省略.........