Original Post
basically i have a terrain in my scene that uneven and ive imported an md2 car. To make it seem asthough the car is stuck to the ground I have taken a point at the front, back, right and left side of the car then tested their Y position against the terrain and then with a little bit of maths found the angle at which the car needs to be rotated to appear as though it is held to the floor with gravity. Problem is that i have to rotate my car's nose up and down so it looks ok when travelling up a hill (which works) annnnnnd tilt left and right if the ground slants to one side (which works) but.............. both together doesnt work as applies one rotate to the car and then with the car in different position it applies the second rotation making the car appear incorrectly.
glRotatef(findGradient2(),1,0,0); //Rotates the car up and down
glRotatef(findGradient(),0,1,0); //rotates the car to the left or right
rendermd2(car);
Its a simple problem and im sure im overlooking a simople solution? Many thanks James