Hello All,
Here is my code,
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
dbLoadObject( "littlemax.X" ,1 );
// make a reference matrix
dbMakeMatrix( 1, 100, 100, 10, 10 );
// our main loop
while ( LoopGDK ( ) )
{
//Controll littlemax.X
if( dbUpKey( ) )
dbPositionObject( 1, dbNewXValue( dbObjectPositionX( 1 ), dbObjectAngleY( 1 ), .4 ), 0, dbNewZValue( dbObjectPositionZ( 1 ), dbObjectAngleY( 1 ), .4 ));
if( dbDownKey( ) )
dbPositionObject( 1, dbNewXValue( dbObjectPositionX( 1 ), dbObjectAngleY( 1 ), -.4), 0, dbNewZValue( dbObjectPositionZ( 1 ), dbObjectAngleY( 1 ), -.4 ));
if( dbLeftKey( ) )
dbYRotateObject( 1, dbObjectAngleY( 1 ) - 1 );
if( dbRightKey( ) )
dbYRotateObject( 1, dbObjectAngleY( 1 ) + 1 );
// CAMERA CODE
dbSetCameraToFollow( dbObjectPositionX( 1 ), dbObjectPositionY( 1 ), dbObjectPositionZ( 1 ), dbObjectAngleY( 1 ), 0, 5, 200, 0 );
dbPointCamera( dbObjectPositionX( 1 ), dbObjectPositionY( 1 ), dbObjectPositionZ( 1 ) );
// update the screen
dbSync ( );
}
// return back to windows
return;
}
I am having a problem with getting the camera to be right behind the character and follow him. Could anyone give me some pointer to get it working.
Thank you,
P.S. I am including my charactor i made.
Leroy
Here i am!!!