View Full Version : function to drive a turn

02-21-2010, 05:51 PM

I've made a car in *.obj files and got them loaded.
Car is going straight forward and backwards by

void SpecialKeyboardFunc (int key, int x, int y) {
radrot = (radrot + 15) % 360;
carx= carx+5;
break; ....

//& handing over the params "radrot" and "carx" to glTranslate and glRotate

Now I have the probleme with driving a nice turn? :confused:
I already created some steering-angle:

lenkung += 1;
if (lenkung > 35) lenkung =34;

I'd like to setup the steer angle before driving the turn.

-> Setup angle -> [Press UP for forward] -> now drive a nice turn.

I thank you in advance for every help!