How would I go about making a third person camera? This is my current code:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbMakeMatrix(2,1000,1000,1,1);
dbLoadObject("Assault Trooper.x", 1);
dbPositionObject ( 1, 1, 1, 1 );
dbRotateObject ( 1, 90, 180, 180 );
float Movement = dbObjectPositionX(1);
float Facing = 180;
while ( LoopGDK ( ) )
{
if (dbKeyState (17) == 1) // W
{
Movement = Movement - 2.0f;
dbMoveObjectDown ( 1, 2.0f );
}
if (dbKeyState (30) == 1) // A
{
Facing = Facing + 2.0f;
dbYRotateObject ( 1, Facing );
}
if (dbKeyState (31) == 1) // S
{
Movement = Movement + 2.0f;
dbMoveObjectUp ( 1, 2.0f );
}
if (dbKeyState (32) == 1) // D
{
Facing = Facing - 2.0f;
dbYRotateObject ( 1, Facing );
}
dbSync ( );
}
return;
}
As you can see I want the camera to ALWYAS be behind the Object (ex. Cant see the front of the model). If you need any more info just let me know!
LOL