Hi guys, im beginner with Dark GDK, and i need some help.How to make crosshair and aiming gun ? I need help please, this is my code:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbLoadSound("start.wav", 99);
dbPlaySound(99);
dbSyncOn ( );
dbSyncRate ( 60 );
dbLoadObject("Atomiser.x",10);
dbPositionObject(20,100,0,100);
dbRotateObject(20,-90,180,0);
dbRotateObject(10,-90,0,0);
dbPositionObject(10,10,-15,20);
dbLockObjectOn(10);
dbSetObjectCollisionToPolygons ( 20 );
dbSetCameraRange ( 1.0f, 30000.0f );
dbLoadImage ( "texture.jpg", 1 );
dbLoadImage ( "detail.jpg", 2 );
dbSetupTerrain ( );
dbMakeObjectTerrain ( 1 );
dbSetTerrainHeightMap ( 1, "map.bmp" );
dbSetTerrainScale ( 1, 3.0f, 0.6f, 3.0f );
dbSetTerrainLight ( 1, 1.0f, -0.25f, 0.0f, 1.0f, 1.0f, 0.78f, 0.5f );
dbSetTerrainTexture ( 1, 1, 2 );
dbBuildTerrain ( 1 );
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbScaleObject ( 2, 30000, 30000, 30000 );
dbPositionCamera ( 385, 23, 100 );
dbSetObjectTexture ( 2, 3, 1 );
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
while ( LoopGDK ( ) )
{
dbControlCameraUsingArrowKeys ( 0, 2.0f, 2.0f );
float fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ), dbCameraPositionZ ( ) );
dbPositionCamera ( dbCameraPositionX ( ), fHeight + 10.0f, dbCameraPositionZ ( ) );
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.4f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.4f );
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
dbUpdateTerrain ( );
dbSync ( );
}
}