I find the camera quite inconvenient to explore the whole 3D environment.
For Maya camera, using arrow keys to control camera movement is not allowed. It is not so user friendly if I want to go deeper in the scene (z-axis).
For First person view, although this time I can use arrow keys, I need to press "Alt" in order to let the mouse cursor move and after pressing "Alt", all the animation stops.
Is there any other better camera supported by Irrlicht?
Why isnt there a camera which allows users to use WASD to move like video games?
Problems with Tutorial 09
-
- Posts: 39
- Joined: Mon Sep 06, 2010 5:09 pm
- Location: Italy
You can code your own key mapping for the camera movement keys if you want.
Code: Select all
scene::ICameraSceneNode* cam = 0;
SKeyMap keyMap[10];
keyMap[0].Action = EKA_MOVE_FORWARD;
keyMap[0].KeyCode = KEY_KEY_W;
keyMap[1].Action = EKA_MOVE_FORWARD;
keyMap[1].KeyCode = KEY_UP;
keyMap[2].Action = EKA_MOVE_BACKWARD;
keyMap[2].KeyCode = KEY_KEY_S;
keyMap[3].Action = EKA_MOVE_BACKWARD;
keyMap[3].KeyCode = KEY_DOWN;
keyMap[4].Action = EKA_STRAFE_LEFT;
keyMap[4].KeyCode = KEY_KEY_A;
keyMap[5].Action = EKA_STRAFE_LEFT;
keyMap[5].KeyCode = KEY_LEFT;
keyMap[6].Action = EKA_STRAFE_RIGHT;
keyMap[6].KeyCode = KEY_KEY_D;
keyMap[7].Action = EKA_STRAFE_RIGHT;
keyMap[7].KeyCode = KEY_RIGHT;
keyMap[8].Action = EKA_JUMP_UP;
keyMap[8].KeyCode = KEY_SPACE;
keyMap[9].Action = EKA_JUMP_UP;
keyMap[9].KeyCode = KEY_NUMPAD0;
cam = smgr->addCameraSceneNodeFPS(0, 120.0f, 0.5f, -1, keyMap, 10, true, 2.5f);
cam->setPosition(core::vector3df(445,50,520));
cam->setTarget(core::vector3df(750,-16,1100));
You can also press the ESC button if you want to get control of the mouse and the animation won't stop.I need to press "Alt" in order to let the mouse cursor move and after pressing "Alt", all the animation stops.