Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Bug (maybe).

Author
Message
I need information
16
Years of Service
User Offline
Joined: 17th Mar 2008
Location:
Posted: 11th Jun 2008 18:36
I think that there are some bugs in dbRollCameraLeft and dbRollCameraRight functions. I have written:
#include "DarkGDK.h"
class plane {
public:
int maxhp, maxfuel, maxspeed, handling, turning, acceleration, id;
}c[2][1];
class flyer {
public:
int plane, clas, hp, money, status, fuel, speed;
}user;
// 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 );
dbSetImageColorKey ( 0, 0, 0);
dbLoadImage("ClandscapeL.jpg", 1);
dbLoadImage("landscapeD.jpg", 2);
dbLoadObject("1st1cjet.x", 3);
dbScaleObject(3, 100, 90, 100);
dbPositionObject(3, 10544, 100, 20068);
dbSetupTerrain();
dbMakeObjectTerrain(1);
dbSetTerrainHeightMap(1, "ClanscapeH.bmp");
dbSetCameraRange(1, 40000);
dbSetTerrainScale ( 1, 60, 40, 60 );
dbSetTerrainSplit ( 1, 24 );
dbSetTerrainTiling ( 1, 4 );
dbSetTerrainLight ( 1, 1.0, -0.25, 0.0, 1, 1, 0.78, 0.5 );
dbSetTerrainTexture ( 1, 1, 2 );
dbBuildTerrain ( 1 );
c[0][0].acceleration = 1;
c[0][0].handling = 1;
c[0][0].id = 3;
c[0][0].maxspeed = 10;
c[0][0].turning = 10;
user.plane = 0;
user.clas = 1;
user.money = 500;
user.status = 1;
c[0][user.plane].id = 3;
dbRotateCamera(0, 90, 0);
dbSetObjectToCameraOrientation(c[0][user.plane].id);
// our main loop
dbHideMouse();
while ( LoopGDK ( ) )
{
if (user.status == 0) {
dbPositionObject(c[0][user.plane].id, 522, 5, 1017);
user.status = 1;
}
if (user.status == 1) {
if(dbKeyState(17))
dbXRotateCamera(dbCameraAngleX() + c[0][user.plane].turning);
if(dbKeyState(31))
dbXRotateCamera(dbCameraAngleX() - c[0][user.plane].turning);
if(dbKeyState(30))
dbRollCameraLeft(c[0][user.plane].turning);
if(dbKeyState(32))
dbRollCameraRight(c[0][user.plane].turning);
if(dbKeyState(78))
user.speed += c[0][user.plane].acceleration;
if(dbKeyState(74))
user.speed -= c[0][user.plane].handling;
dbMoveObject(c[0][user.plane].id, user.speed);
dbPositionCamera(dbObjectPositionX(c[0][user.plane].id), dbObjectPositionY(c[0][user.plane].id), dbObjectPositionZ(c[0][user.plane].id));
dbXRotateCamera(dbCameraAngleX() + 90);
dbMoveCamera(-1.5);
dbXRotateCamera(dbCameraAngleX() - 90);
dbMoveCamera(-3.5);
dbPositionMouse(dbScreenHeight()/2, dbScreenWidth()/2);
dbSetObjectToCameraOrientation(c[0][user.plane].id);
dbUpdateTerrain();
dbSync ( );
}
}
// return back to windows
return;
}

There if the angle of camera is 0, 90, 0 exactly, and if I have rolled camera left by 180, then I the camera suddenly rolls another
180. Same thing on turning right. And also if I roll a little left and then little more right, then the camera turns around its y axis
by 180.
I need information
16
Years of Service
User Offline
Joined: 17th Mar 2008
Location:
Posted: 12th Jun 2008 14:04
It can be fixed by rotating camera around its x axis, so the x angle isn't 90 before the dbRollCamera functions, but it is still a bug (maybe).

Login to post a reply

Server time is: 2024-11-20 13:33:58
Your offset time is: 2024-11-20 13:33:58