umm... for some reason, i don't know why i try to upload the rar file with my project but i keep on finding this "automatic_file"... so i don't know... the file should be a 15Mb rar file.
Anyway here is the code, there is no texture or X file provided thou:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 100 );
dbMakeCamera (0);
dbAutoCamOff ();
dbSetDisplayMode (1600,1200,0);
dbSetWindowOff ();
//load mouse pointer image and hide the mouse
//dbLoadImage ("cursor.png",1);
//dbHideMouse ();
dbLoadImage ("enviro.jpg",2);
//camera position
dbPositionCamera (0,500,0);
dbSetCameraRange (1,2000);
dbPitchCameraDown (30);
dbSetCameraFOV (35);
// load terrain
dbLoadObject ("terrain.x",10);
dbScaleObject (10,10000,10000,10000);
dbSetObjectCull (10,0);
dbScaleObjectTexture (10,500,500);
dbSetObjectSpecular ( 10, 0 );
//load sky
dbMakeObjectSphere (11,10000);
dbSetObjectCull (11,0);
dbColorObject (11,dbRGB(186,169,103));
dbSetObjectEmissive (11,dbRGB(186,169,103));
//load motorbike object
dbLoadObject ("motorcycle.x",12);
dbScaleObject (12,100,100,100);
dbSetObjectCull (12,0);
dbPositionObject (12,0,0,0);
dbSetObjectCull (12,0);
dbSetObjectSpecular ( 12, 0 );
dbFixObjectPivot (12);
dbTextureObject (12,2);
//dbSetSphereMappingOn (12,2);
while ( LoopGDK ( ) )
{
//main loop
// display cursor image
dbSprite (1,dbMouseX(),dbMouseY(),1);
// create lights and shadows
dbMakeLight(30);
dbSetDirectionalLight (30,50,50,50);
dbColorLight (30,dbRGB(186,169,103));
dbPointLight (30,0,0,0);
dbSetNormalizationOn ();
//dbSetGlobalShadowsOn();
//disable the backdrop
dbBackdropOff ();
// motorcycle controls
//dbSetObjectInterpolation (12,10000);
//stop the animation
if ((dbUpKey())+(dbRightKey())+(dbLeftKey()) == 0 );
{
dbStopObject (12);
}
if ( dbUpKey() == 1 )
{
dbLoopObject (12,18000,22000);
dbMoveObject (12,+5.0f);
dbSetObjectSpeed (12,100000);
}
if (dbRightKey() ==1)
{
dbLoopObject (12,10000,14000);
dbTurnObjectRight (12,5);
dbSetObjectSpeed (12,50000);
}
if (dbLeftKey() ==1)
{
dbLoopObject (12,14000,18000);
dbTurnObjectLeft (12,5);
dbSetObjectSpeed (12,50000);
}
if (dbDownKey() ==1)
{
dbLoopObject (12,18000,20000);
dbMoveObject (12,-5.0f);
dbSetObjectSpeed (12,100000);
}
if (dbSpaceKey() ==1)
{
dbLoopObject (12,1,14000);
dbMoveObject (12,5.0f);
dbSetObjectSpeed (12,100000);
}
// object moves wheverer the mouse clicks following 2D coordinates (XZ) while the camera follows and centers on the object position with momentum
dbSetCameraToFollow (dbObjectPositionX(12),dbObjectPositionY(12),dbObjectPositionZ(12),0,100,75,5,0);
dbSync ( );
}
}