Page 1 of 1

rotate camera

Posted: Wed Jun 29, 2005 1:46 am
by MikeR
I have been searching the forum, but can only find out how to rotate the camera using the mouse. What I need to do is to rotate the camera using the arrow keyes.
EET_KEY_KEY_RIGHT=rotate right etc...
Is there an example around here that will tell me how to do this? Or an example tutorial on the web?

Posted: Wed Jun 29, 2005 6:08 am
by after-life
i think you will have to code it yourself do something like this:
- store the angles in AngleX, AngleY (you dont need Z cause you can only rotate in 2 ways :p)
- if right arrow is pressed AngleX += 0.1 (or something like that)
- if left arrow is pressed AngleX -= 0.1
- if up arrow is pressed AngleY += 0.1 (or something like that)
- if down arrow is pressed AngleY -= 0.1

then do camera->setRotation(AnbleX,AngleY,0)

good luck, maybe you will have to adjust it a bit (i dont know what you want to do whit it :p)