I have this so far:
#include "DarkGDK.h"
void DarkGDK( void) {
dbSyncOn( );
//dbSetDisplayMode ( 800, 600, 16);
dbMakeObjectCube( 1, 10.0);
dbMoveCamera( -50);
float fX = dbObjectPositionX( 1);
float fY = dbObjectPositionY( 1);
float fZ = dbObjectPositionZ( 1);
dbPositionObject( 1, fX, fY, fZ);
char sX[ 255];
char sY[ 255];
char sZ[ 255];
while (!dbSpaceKey( )) {
if (dbLeftKey( )) {
dbMoveObjectLeft( 1, 2.0);
}
else if (dbRightKey( )) {
dbMoveObjectRight( 1, 2.0);
}
else if (dbUpKey( )) {
dbMoveObjectUp( 1, 2.0);
}
else if (dbDownKey( )) {
dbMoveObjectDown( 1, 2.0);
}
fX = dbObjectPositionX( 1);
fY = dbObjectPositionY( 1);
fZ = dbObjectPositionZ( 1);
sprintf( sX, "%f", fX);
sprintf( sY, "%f", fY);
sprintf( sZ, "%f", fZ);
dbText( 10.0, 10.0, sX);
dbText( 10.0, 20.0, sY);
dbText( 10.0, 30.0, sZ);
dbSync( );
}
}
Is there a function to move an object along it's z coordinates?
The reason for this dumb program is to get me to grips with the way vectors work in DarkGDK, it seems to work in a very strange manor.
- Scarface