rotate camera

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

rotate camera

Post 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?
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
after-life
Posts: 69
Joined: Wed Mar 30, 2005 8:16 am
Location: Keerbergen, Belgium

Post 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)
Post Reply