Hi,
I’m trying to write a flight simulator but I’m having a problem with the code. Basically I’m taking the input from a joystick(hence only 2 axis for movement). I’ve been looking into quaternions but not 100% sure how to use them. Has anyone else got an algorithm, or see a major fault in my code.
Thanks.
Alasdair.
Joy Z and Y are taken from a joystick
RotateScene is a constant.
ZAngle = (RotateScene * JoyZ)
XAngle =(RotateScene * joyY);
…
glPushMatrix();
glRotated(XAngle,-1.0, 0.0,0.0);
glRotated(ZAngle,0.0,0.0,1.0);
glTranslated(XTrans, YTrans, ZTrans);
glCallList(thePoints);
glPopMatrix();