Thank you for the hangman code example.
I enjoyed playing it and I tried to understand the code with the limbs.
So i tried to program my own example, but the problem is, it doesn't work.
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
dbPrint ( "Please wait loading model..." );
dbSync ( );
dbSync ( );
//Give the numbers names so we can read it better
int torso = 1;
int arm = 2;
//Number for the temporary objects and meshes
int idTempObj = 100;
int idTempMesh = 101;
int magnification = 4000;
//load the objects
dbLoadObject ( "torso.X", torso );
dbPositionObject(torso, 0, 0, 0);
dbScaleObject ( torso, magnification, magnification,magnification);
dbLoadObject ( "arm.X", arm );
dbScaleObject ( arm, magnification, magnification,magnification);
//Put the torso & arm together
dbMakeMeshFromObject(idTempMesh, torso);
dbAddLimb(torso, 1, idTempMesh);
dbOffsetLimb(torso, 1, 0, 0, 0);
dbDeleteMesh(idTempMesh);
dbPositionCamera ( 0, 50, -80 );
int r;
// our main loop
while ( LoopGDK ( ) )
{ r=r+2;
dbRotateLimb(torso, 1, r, 0, 0);
dbControlCameraUsingArrowKeys(0, 1.0, 1.0);
// update the screen
dbSync ( );
}
// return back to windows
return;
}
The programm runs and I can see the torso and the arm model in the scene, but the arm is not rotating.
What did I wrong?
regards
MES