I'm trying to make a basic 3d environment with a ship that can fly around. I would like the camera to follow this ship from a 3rd person perspective. I tried using SetToFollow, but when the ship turns the camera doesn't turn with it. The camera continues to "follow" but from the same perspective.
here is my while loop
while (DarkGDK.Engine.LoopGDK)
{
DarkGDK.Camera.DefaultCamera.SetToFollow(ship.X, ship.Y, ship.Z, 0, 30, 10, 1, true);
if (DarkGDK.IO.Keyboard.State(DarkGDK.IO.Keys.W))
{
ship.Move(1);
}
if (DarkGDK.IO.Keyboard.State(DarkGDK.IO.Keys.A))
{
ship.TurnLeft(3);
}
if (DarkGDK.IO.Keyboard.State(DarkGDK.IO.Keys.D))
{
ship.TurnRight(3);
}
DarkGDK.Core.Sync();
}
Thanks for your help!
*EDIT
I found another post that mentioned re-positioning the right behind the object, and then just back up a bit. This seemed to work.
DarkGDK.Camera.DefaultCamera.PositionCurrent(ship.X, ship.Y, ship.Z);
DarkGDK.Camera.DefaultCamera.CurrentAngleX = ship.AngleX;
DarkGDK.Camera.DefaultCamera.CurrentAngleY = ship.AngleY;
DarkGDK.Camera.DefaultCamera.CurrentAngleZ = ship.AngleZ;
DarkGDK.Camera.DefaultCamera.MoveBackward(10);