Rotate camera using keyboad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kraus
    1000 Post Veteran

    • Jan 2001
    • 1086
    • Madison, Wisconsin
    • General

    #1

    Rotate camera using keyboad

    Can the camera be rotated using the keyboard? The arrow keys will move the camera, and along with the space bar will lower and raise the camera.
  • kraus
    1000 Post Veteran

    • Jan 2001
    • 1086
    • Madison, Wisconsin
    • General

    #2
    Found the camera movement code in file CameraRot.cpp. If the following lines were added to

    function void CameraRot::keyDown(QKeyEvent * e) {

    then these keys would rotate the camera.

    case Qt::Key_J: // rotate left
    patrzX(-0.05f);
    break;
    case Qt::Key_L: // rotate right
    patrzX(0.05f);
    break;
    case Qt::Key_I: // look up
    patrzY(0.05f);
    break;
    case Qt::Key_K: // look down
    patrzY(-0.05f);
    break;

    Comment

    Working...