Try this:
void OrbitCamera(void){
AngleY+=float(dbMouseMoveX())*Time/100.0f;
AngleX+=float(dbMouseMoveY())*Time/100.0f;
Distance-=float(dbMouseMoveZ())*Time/100.0f;
dbPositionCamera(0,0,0);
dbRotateCamera(AngleX,AngleY,0.0f);
// dbPitchCameraUp(float(dbMouseMoveY())); //use these for full range of motion
// dbTurnCameraRight(float(dbMouseMoveX())); //not just fixed camera "up"
dbMoveCamera(-Distance);
}
You will have to declare globals:
float AngleY,AngleX,Distance;
If you want to only move the camera when you do a key press like rightclick(), then you will have to do something like this:
if (dbMouseClick()==2){
OrbitCamera();
}
else {
float tmp=dbMouseMoveX();
tmp=dbMouseMoveY();
tmp=dbMouseMoveZ();
//this is so that during any time you are not wanting to move the camera it will reset the dbMouseMove's so that when you do "rightclick" the camera won't jump.
}
The part with dbPositionCamera(0,0,0); is where you would set it to your "player object".
The fastest code is the code never written.