本文整理汇总了C++中Viewport::fov方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::fov方法的具体用法?C++ Viewport::fov怎么用?C++ Viewport::fov使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::fov方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyboardSpecial
void keyboardSpecial(int key, int x, int y)
{
bool isShift = ((glutGetModifiers() & GLUT_ACTIVE_SHIFT) != 0);
bool changed = true;
int target = -1;
int target_index = -1;
int step_target = -1;
switch (key)
{
case GLUT_KEY_DOWN:
win.setFOV(win.fov() * 1.05);
break;
case GLUT_KEY_UP:
win.setFOV(win.fov() / 1.05);
break;
case GLUT_KEY_F1:
target = 0;
target_index = 0;
break;
case GLUT_KEY_F2:
target = 0;
target_index = 1;
break;
case GLUT_KEY_F3:
target = 0;
target_index = 2;
break;
case GLUT_KEY_F4:
target = 0;
target_index = 3;
break;
case GLUT_KEY_F5:
target = 1;
target_index = 0;
break;
case GLUT_KEY_F6:
target = 1;
target_index = 1;
break;
case GLUT_KEY_F7:
target = 1;
target_index = 2;
break;
case GLUT_KEY_F8:
target = 1;
target_index = 3;
break;
case GLUT_KEY_F9:
step_target = 0;
changed = false;
break;
case GLUT_KEY_F10:
step_target = 1;
changed = false;
break;
}
if (target != -1)
{
if (settings_target == 0)
{
// Set user parameters
float add;
if (isShift)
add = -user_params_steps[target];
else
add = +user_params_steps[target];
user_params[target][target_index] += add;
tellUserParams();
}
else if (settings_target == 1 && target < 3)
{
// Set lights
float add;
if (isShift)
add = -lights_step;
else
add = +lights_step;
lights_diffuse[target][target_index] += add;
// Clip
if (lights_diffuse[target][target_index] > 1.0)
lights_diffuse[target][target_index] = 1.0;
else if (lights_diffuse[target][target_index] < 0.0)
lights_diffuse[target][target_index] = 0.0;
//.........这里部分代码省略.........