i just can't figure out how to do gravity and gun placement in a 3d map. and how do i get the camera to be first person witha character so that he can move?
heres my code so far any help is very much apreciated.
// Dark GDK - The Game Creators - www.thegamecreators.com
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
#include "DarkSDKMusic.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 );
dbPrint("please wait loading map...");
dbMaximizeWindow();
// switch to the media directory, load our world
// and turn lighting off
SetCurrentDirectory ( "media" );
dbLoadObject ( "universe.dbo", 1 );
dbSetObjectLight ( 1, 120 );
dbSetObjectCollisionToPolygons(1);
// load a model for our sky
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbSetObjectTexture ( 2, 3, 2 );
dbScaleObject ( 2, 5000, 5000, 5000 );
dbSetObjectCollisionOff(2);
// load music
dbLoadMusic("JellyFish.mid", 3);
dbSetMusicVolume(3,20);
dbLoopMusic(3);
// load and postion a gun
dbLoadObject ( "H-Tommy-Static.x", 4 );
dbRotateObject (4,-90,0,0);
dbPositionObject (4,10,-15,20);
// load the character
dbLoadObject ( "Colonel-X.X", 5 );
dbPositionCamera ( 5, 0, 10 );
// position the camera
dbPositionCamera ( 434, 42, -517 );
dbAutomaticCameraCollision(0,5,0);
// camera variables
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
int map_collision=0;
// our main loop
while ( LoopGDK ( ) )
{
// move the camera using the arrow keys and hide the mouse
dbControlCameraUsingArrowKeys ( 0, 4.0f, 4.0f );
dbHideMouse();
// create a rotation axis based on mouse movement and use the right/left keys to rotate
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.3f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.3f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbRightKey ( ) * 1.0f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbLeftKey ( ) * -1.0f );
// rotate camera
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
// update the screen
dbSync ( );
}
// return back to windows
return;
}
nubs