
Quaternion Camera And Movement
Posted Saturday, 19 February, 2011 - 01:14 by Radar inHi all,
i've implemented a Quaternion-Camera and it works so far i can rotate and move around BUT:
The movement does not follow the rotation. I can only move on the Z and X axes, but not inbetween them. So it feels like iam sitting in a train and look outide the window.
But i want a FPS Camera.
I guess this is a know problem for the cracks but i couldn't find an answer to this problem (i don't even know how to describe that for google)
Someone already knows what i made wrong/forgot?
Thanks in andvance!


Comments
Re: Quaternion Camera And Movement
3 popular kinds of cameras:
1. FPS
2. TPS(third person camera)
3. Quaternion camera.
There is a huge different between 1 and 3.
For FPS and TPS, see:
http://roecode.wordpress.com/2008/02/11/xna-framework-gameengine-develop...
If I understand you wrong and you want quaternion camera, tel it in your comment.
Re: Quaternion Camera And Movement
Hi!
Thank you for your answer.
The basic idea was:
I have a self-made Point3d Class which has a Pos.-Vector and a Quaternion rotation. (like a pivot point)
Then i have a QuaternionCamera Class which extends the Point3d.
And finally i make a FPS Camera which extends the QuaternionCamera.
Any other camera type just extends the QuaternionCamera et viola...
Yeah... that was the idea. But i have a few problems with the camera. Like: How do i limit the rotation of a quaternion or as you mentioned the problem with the precision.
Was the whole idea bad? And if so, why?
Thanks!
Re: Quaternion Camera And Movement
For FPS, it is very recommend you will use yaw, pitch and roll. I've link you to how to do it in XNA, but the math methods are kinda the same in OpenTK.
If you don't know what is it yaw-pitch-roll, see:
http://en.wikipedia.org/wiki/Flight_dynamics
http://en.wikipedia.org/wiki/Euler_angles