how to handle camera ( from external input device )

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
nuc_lear
Posts: 5
Joined: Thu Jan 20, 2011 6:59 pm

how to handle camera ( from external input device )

Post by nuc_lear »

(SOLVED)

Irrlicht's examples' camera moves with left-up-right-down arrow key buttons and rotates.. with mouse.

How i can, move on( key W ), move back( S ), rotate right( D ) and rotate left( A ).I need only that four acts.
Last edited by nuc_lear on Tue Jan 25, 2011 10:25 pm, edited 2 times in total.
lazerblade
Posts: 194
Joined: Thu Mar 18, 2010 3:31 am
Contact:

Post by lazerblade »

Try the manual here

http://irrlicht.sourceforge.net/docu/cl ... 80f2cdddbb

It has exactly what you are asking about W,A,S,D.
LazerBlade

When your mind is racing, make sure it's not racing in a circle.

3d game engine: http://sites.google.com/site/lazerbladegames/home/ray3d
lazerBlade blog: http://lazerbladegames.blogspot.com/
nuc_lear
Posts: 5
Joined: Thu Jan 20, 2011 6:59 pm

Post by nuc_lear »

Actually my question is : how can i handle the camera like keyboard from my external input device( glove with sensors ) which sends rotate and move values..?

@lazerblade thank for reply.The code below solves the WASD.

SKeyMap keyMap[10];
keyMap[0].Action = EKA_MOVE_FORWARD;
keyMap[0].KeyCode = KEY_UP;
keyMap[1].Action = EKA_MOVE_FORWARD;
keyMap[1].KeyCode = KEY_KEY_W;

keyMap[2].Action = EKA_MOVE_BACKWARD;
keyMap[2].KeyCode = KEY_DOWN;
keyMap[3].Action = EKA_MOVE_BACKWARD;
keyMap[3].KeyCode = KEY_KEY_S;

keyMap[4].Action = EKA_STRAFE_LEFT;
keyMap[4].KeyCode = KEY_LEFT;
keyMap[5].Action = EKA_STRAFE_LEFT;
keyMap[5].KeyCode = KEY_KEY_A;

keyMap[6].Action = EKA_STRAFE_RIGHT;
keyMap[6].KeyCode = KEY_RIGHT;
keyMap[7].Action = EKA_STRAFE_RIGHT;
keyMap[7].KeyCode = KEY_KEY_D;

keyMap[8].Action = EKA_JUMP_UP;
keyMap[8].KeyCode = KEY_KEY_J;

keyMap[9].Action = EKA_CROUCH;
keyMap[9].KeyCode = KEY_KEY_C;

camera = smgr->addCameraSceneNodeFPS(0, 100.0f, 0.6f, -1, keyMap, 10, false, 0.6f);
nuc_lear
Posts: 5
Joined: Thu Jan 20, 2011 6:59 pm

Post by nuc_lear »

I solved the problem with system's mouse and keyboard event simulate functions :)
( keybd_event(VkKeyScan('W'),0x9e,0,0); )
Post Reply