Hi all, been a while since i posted here lol 351 unread topics :s

Anyway... i'v started a new project, and im trying to work out how to position my camera behind my player character..

the code i use to position my players character is as below:
[pascal]
procedure MoveForwards(const Run: Boolean = True);
var
Xtra: Single;
begin
If Run Then Xtra := 2 Else Xtra := 0;
Player.Position[0] := (Player.Position[0]-Sin(Player.Heading*Pi/180)*Xngine.GlobalTime/600)-Xtra;
Player.Position[2] := (Player.Position[2]+Cos(Player.Heading*Pi/180)*Xngine.GlobalTime/600)+Xtra;
Player.HeadMovAngle := Player.HeadMovAngle+5;
Player.HeadMovement := 0.025*Sin(Player.HeadMovAngle*Pi/180);
end;

procedure MoveBackwards(const Run: Boolean = True);
var
Xtra: Single;
begin
If Run Then Xtra := 2 Else Xtra := 0;
Player.Position[0] := (Player.Position[0]+Sin(Player.Heading*Pi/180)*Xngine.GlobalTime/600)+Xtra;
Player.Position[2] := (Player.Position[2]-Cos(Player.Heading*Pi/180)*Xngine.GlobalTime/600)-Xtra;
Player.HeadMovAngle := Player.HeadMovAngle-5;
Player.HeadMovement := 0.025*Sin(Player.HeadMovAngle*Pi/180);
end;

procedure FlyHigher;
begin
Player.Position[1] := Player.Position[1]+(Xngine.GlobalTime/600);
end;

procedure FlyLower;
begin
Player.Position[1] := Player.Position[1]-(Xngine.GlobalTime/600);
end;

procedure TurnLeft;
begin
Player.Heading := Player.Heading+5;
If Player.Heading > 360 Then Player.Heading := 0;
end;

procedure TurnRight;
begin
Player.Heading := Player.Heading-5;
If Player.Heading < 0 Then Player.Heading := 360;
end;

procedure TiltUp;
begin
Player.Tilt := Player.Tilt+5;
If Player.Tilt > 60 Then Player.Tilt := 60;
end;

procedure TiltDown;
begin
Player.Tilt := Player.Tilt-5;
If Player.Tilt < -60 Then Player.Tilt := -60;
end;

procedure StepLeft;
begin
Player.Position[0] := Player.Position[0]+Sin((Player.Heading+90)*Pi/180)*Xngine.GlobalTime/900;
Player.Position[2] := Player.Position[2]-Cos((Player.Heading+90)*Pi/180)*Xngine.GlobalTime/900;
end;

procedure StepRight;
begin
Player.Position[0] := Player.Position[0]-Sin((Player.Heading+90)*Pi/180)*Xngine.GlobalTime/900;
Player.Position[2] := Player.Position[2]+Cos((Player.Heading+90)*Pi/180)*Xngine.GlobalTime/900;
end;
[/pascal]

I thought that i could use gluLookAt, but i cant seem to grasp how to use it correctly :s

The rotation and positions get randomly messed up when i move my character..

Thanx for any help