1. Flight Simulator Viewing System

I am currently writing a Flight simulator, using OpenGL and Glut in c
I have found some dificulty in getting the rotations of the view to function how I hoped they would
I know each rotation must occure in the coordinate system of the planes mothion rather than the world coordinate system.
to explain as I adont think I'm making any sense, to pitch forward or back, this is a rotation in the axis defined by the wings (possably tip to tip). to roll the plane it must be rotated about the axis defined by the direction the plane is pointing, so from nose to tail. and to yaw or use the rudder the rotation must occure about the upward direction of the plane, these axis would be centered at the center of the plane

I have a choice of rotating either the up and direction vectors of the plane and then using glulookat() to position the plane in the world where it should be
or leave the camera at the center and rotate the world about it

at the current state I'm performing the rotations on the world, using my own matrix for the planes rotations, with a new rotation added each time
however to display the world I I use gltranslate to position the objects and load the matrix to do the rotations

glTranslatef(-plane.position.Vals[0],-plane.position.Vals[1],-plane.position.Vals[2]); // translates it

I have also tried using glmultmatrix after the gl translate call but this made no visable difference

I hope some one can help me with this

I'm attaching the current system so you can see whats happening
use your numberpad to controll the rotations 2+8 pitch, 4+6 roll, 1+3 yaw. this is coded to the numbers.

PS I cant ask anyone to write me the code to fix this as its for a uni project, but pointers in the right direction or algorithms will be greatly appreciated

2. ok i would recommend moveing the camera and the plane NOT the world.

So exactly whats the error?

is the plane rotating and not the camera?
is the world moving with the plane?
is the camera not moving right or what?

3. The problem is its not rotating how it should

if the first thing you do is turn with the rudder then if you try to pitch it doesnt rotate about the right axis it rotates diagnally instead of virtically, I'm not very good at explaining things wich is why I've included the program in the original post, so you can see for yourself, you will find that the glut libraries need to be installed, but the dll that was needed was too big to add to the zip

4. ok i think i know what your problem is...

you need to us gl(Push/Pop)Matrix() around your transformations, like so.

Code:
```glPushMatrix();

TransformObject();
DrawObject();

glPopMatrix();

//rinse and repeat```
you can also nest them for complex moving objects.

5. Originally posted by no-one
ok i would recommend moveing the camera and the plane NOT the world.

So exactly whats the error?

is the plane rotating and not the camera?
is the world moving with the plane?
is the camera not moving right or what?
thanks for the advise but I'm not sure how to pull that off, as the camera is the plane and for the rotations to work propery for each rotation I'd have to rotate about a new axis as it would have changed

in answere to the second question I'm actually ignoring any motion apart from the rotation of the plane(camera)

6. Originally posted by no-one

Code:
```glPushMatrix();

TransformObject();
DrawObject();

glPopMatrix();

//rinse and repeat```
I wish I'd got to a stage where that would be usefull, but my proplems in the transformations
I'm sure its probably something stupid that I've done it usually is

7. thanks for the suggestions, I think I've solved it now, like I said in my last post its probably something stupid, I was right it was, I was rotating matricies backwards so the rotations went wrong, no I can start work on making it actually worth all the effort

8. Are you sure you want to be putting your entire landscape into a display list? Or is your landscape very repetitive?

9. I'm not really that sure no, but as it stands the landscpae is just a flat grid of dots, as I have no intention of the landscape changing the book I was using said that was a good optimisation, I am having second thoughts about this though as most the landscape will end up out of site and be wasting time being plotted, I just havent got asfar as working out a quick visablity check
I am planning a level of deatail check so that if your high up it doesnt plot a high detail landscape, but I havnt got that far yet and only have 4 weeks left to finish ad document it