Wel, I just made my camera to make you look around, but now the camera stay's on it's place and it turns around itself, what I want to try is make the camera always point your object, so that it's always in the middle of the screen. These are my code's:
Main:
#include "DarkGDK.h"
#include "PlayerProperties.h"
#include "CameraProperties.h"
#include "Main.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
while ( LoopGDK ( ) )
{
Game ();
MoveCamera ();
dbSync ( );
}
return;
}
void Game ( void )
{
GameSetup ();
}
void GameSetup ( void )
{
CreatePlayer ();
CreateCamera ();
}
CameraProperties:
#include "DarkGDK.h"
#include "CameraProperties.h"
// Creates and Customizes the Camera
void CreateCamera ( void )
{
dbPositionCamera ( 0, 0, -10 );
}
float MCameraAngleX = dbCameraAngleX();
float MCameraAngleY = dbCameraAngleY();
void MoveCamera ( void )
{
dbHideMouse();
dbPositionMouse ( dbScreenWidth()/2 , dbScreenHeight()/2 );
MCameraAngleX = dbWrapValue (MCameraAngleX + dbMouseMoveY() * 0.2f);
MCameraAngleY = dbWrapValue (MCameraAngleY + dbMouseMoveX() * 0.2f);
dbXRotateCamera( MCameraAngleX );
dbYRotateCamera( MCameraAngleY );
}
PlayerProperties ( still just the test, didn't detail it. ):
#include "DarkGDK.h"
#include "PlayerProperties.h"
//Creates the Player
void CreatePlayer ( void )
{
dbLoadObject ("Assets//RedPlayer.x", 1);
}
And the header files are made, but i don't think they are neccecery for you to help me.
Already thanks for your help.