I am trying to implent a simple camera in my project and I am having some problems with the code. Actually for quite a while now, so I am almost desperate for help.
Thanks for the time.
(Heading should be called Yaw I guessed)
The Pitch-part is the problem.Code :gluLookAt(Camera.PosX, Camera.PosY, Camera.PosZ, Camera.DirX, Camera.DirY, Camera.DirZ, 0.0, 1.0, 0.0); //The above is in the Drawing code and not the problem actually DirX = PosX + HeadingSin; DirZ = PosZ - HeadingCos; //Ok, that works fine. DirY = PosY + PitchSin; //That works semifine.
When the value starts getting close 90
the camera starts pointing downwards again.
I know that makes sense and I tried lots of
different approaches using PitchCos and so
on... Sometimes the camera will just point
in the reversed direction.
I don't understand it.
Should this not be working:
DirY = PosY + PitchCos;
DirZ = PosZ + PitchSin;
I hope you have some advice. It is very appreciated.
[This message has been edited by B_old (edited 10-16-2002).]