Hi guys.I am newbie to Dark GDK.How can i get the camera a little left of character? (I mean that the camera will show the character from the left side of him.)I tried that but when i want to turn character,the crosshair appears on character's head.
#include "DarkGDK.h"
#include "Keys.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
dbSetDisplayMode ( 1440, 900, 32 );
dbSetWindowPosition(0,0);
dbHideMouse();
dbAutoCamOff();
dbSetWindowOff();
dbMaximizeWindow();
dbMakeMatrix(1,4000,4000,100,100);
dbSetMatrixHeight(1,50,50,500);
dbUpdateMatrix(1);
dbLoadObject("Media//ColZ.X",1);
dbLoadImage("Media//crosshair.png",2);
dbSprite(2,dbScreenWidth()/2,dbScreenHeight()/2,2);
dbHideSprite(2);
dbLoadObject("Media//Atomiser.X",3);
dbSyncOn ( );
dbSyncRate ( 60 );
float ya;
float an;
float x;
float y;
float z;
float angle;
float distance(150.0);
float height;
float smooth;
dbGlueObjectToLimb(3,1,22);
dbScaleObject(3,193,193,193);
dbRotateObject(3,180,180,267);
dbSetObjectSpeed(1,10000);
// work can be carried out by the GDK
while ( LoopGDK ( ) )
{
if(dbMouseClick()==MouseRight){
dbShowSprite(2);
}
else
{
dbHideSprite(2);
}
if (KeyW)
{
dbLoopObject(1,27000,32000);
dbXRotateObject(1,0);
dbMoveObject(1,4);
}
else
{
dbStopObject(1);
}
if (KeyS)
{
dbXRotateObject(1,180);
dbMoveObject(1,4);
}
if (KeyA)
{
ya=ya-2;
}
if (KeyD)
{
ya=ya+2;
}
dbRotateObject(1,-90,ya,0);
x=dbObjectPositionX(1);
y=dbObjectPositionY(1);
z=dbObjectPositionZ(1);
angle=dbObjectAngleY(1);
height=180.0;
smooth=12.0;
dbSetCameraToFollow(x,y,z,angle,distance,height,smooth,0);
dbSync ( );
}
}
Sorry for my English.Any help will be appreciated.