Sure, every post on this thread goes to my mailback address.
Here is a program that uses the same object as the one you were using where all the code for the movement of the camera and the object are in a function. Note, to make my coding easier I used camera 0.
#include "DarkGDK.h"
//global vars
float rolla=0;
float cry=0;
float crx=0;
float cr=32767;
float dist=10;
float rvx=0;
float rvy=0;
void camandplanex(void);
void DarkGDK ( void )
{
// entry point for the application
// switch on sync rate and set to a maximum of 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
//dbSetDisplayMode (800, 600, 32);
//Camera Settings
//dbMakeCamera(100);
//dbPositionCamera(100,1900,3000,1900);
//dbRotateCamera (100,90,0,0);
//dbSetObjectRotationXYZ ( 3 ) ;
///dbSetCameraRotationXYZ ( 100) ;
//Object Settings
dbLoadObject("H-Jet Fighter 2-Move.x", 3);
dbLoadImage("JetFigh2.dds", 4);
dbTextureObject(3,4);
//dbPositionObject(3,0,100,-50);
//dbRotateObject(3,0,180,0);
//dbPlayObject(3,0,3);
//dbSetObjectSpeed(1,10);
float angy=dbObjectAngleY(3);
float angx=dbObjectAngleX(3);
float angz=dbObjectAngleZ(3);
while ( LoopGDK ( ) ){
//This requires an xbox 360 controller
camandplanex();
if ( dbEscapeKey ( ) ){
break;
}
dbSync ( );
}
return;
}
void camandplanex(void){
if(rvx>0){
rvx=rvx-.2;
if(rvx<0)
rvx=0;
}else{
rvx=rvx+.2;
if(rvx>0)
rvx=0;
}
if(rvy>0){
rvy=rvy-.2;
if(rvy<0)
rvy=0;
}else{
rvy=rvy+.2;
if(rvy>0)
rvy=0;
}
// responds to the left stick
if ( dbJoystickY ()<-500){
if(rvx>-2 ){
rvx=rvx-.25;
}else{rvx=-2;}
}
//
if ( dbJoystickY ()>500){
if(rvx<+2){
rvx=rvx+.25;
}else{rvx=2;}
}
if ( dbJoystickX ()<-500){
if(rvy>-2 ){
rvy=rvy-.25;
}else{rvy=-2;}
}
//
if ( dbJoystickX ()>500){
if(rvy<+2){
rvy=rvy+.25;
}else{rvy=2;}
}
//rotates and moves the plane
dbRollObjectRight(3,-rvy);
dbPitchObjectDown ( 3, rvx );
dbMoveObject(3,-1);
//responds to the right stick
/////////this code is only used when the camera is set to move freely about the object, but it does not need to be suspended
if(dbAbs(dbJoystickTwistY ( )-cr)<4205){
cry=cr;
}else{
cry=dbJoystickTwistY ( );
}
if(dbAbs(dbJoystickTwistX ( )-cr)<4205){
crx=cr;
}else{
crx=dbJoystickTwistX ( );
}
/////////////////////
//////this code positions the camera behind the plane
dbSetCameraToObjectOrientation(3);
dbPitchCameraDown ( 180-15 );
dbRollCameraRight(180);
dbPositionCamera(dbObjectPositionX(3),dbObjectPositionY(3),dbObjectPositionZ(3));
dbMoveCamera(-dist);
dbPitchCameraDown ( -15 );
///suspend the above and activate the bellow to allow the camera to move freely about the plane
//dbRotateCamera(dbCameraAngleX()+cry *.0001-cr*.0001,dbCameraAngleY()+crx *.0001-cr*.0001,dbCameraAngleZ());
//dbPositionCamera(dbObjectPositionX(3)-dist*dbCos(dbCameraAngleX())*dbSin(dbCameraAngleY()),dbObjectPositionY(3)+dist*dbSin(dbCameraAngleX()),dbObjectPositionZ(3)-dist*dbCos(dbCameraAngleX())*dbCos(dbCameraAngleY()));
}
This code allows you to use an xbox 360 controller in the program.
I won't be able to connect to the internet for awhile so I won't be able put one up that uses the mouse and keys. However, You could modify the code to use the keys if you replace the dbjoystick comands with the arrow keys.
uuhh... yah...