I'm suggesting you all got the Dark Matter package.
I have tried to spawn one of the darkmatter models inside my DarkGDK project. I used the AppendObject function to simplify the code, the code to load the object goes like this:
this->ModelID = GetNextObjectID();
dbLoadObject(this->_IdleModel, this->ModelID);
dbAppendObject(this->_RunModel, this->ModelID, dbTotalObjectFrames(this->ModelID));
dbAppendObject(this->_DieModel, this->ModelID, dbTotalObjectFrames(this->ModelID)+1);
dbSetObjectInterpolation(this->ModelID, 2);
dbHideObject(this->ModelID);
And then for doing the animations i wrote this in the main loop
if(ClickAbleText( 0, 0, "All"))
{
}
if(ClickAbleText( 0, 15, "Idle"))
{
if(dbObjectFrame(NinjaObject) > 25)
{
dbSetObjectFrame(NinjaObject, 0);
}
}
if(ClickAbleText( 0, 30, "Run"))
{
if(dbObjectFrame(NinjaObject) > 50)
{
dbSetObjectFrame(NinjaObject, 30);
}
if(dbObjectFrame(NinjaObject) < 25)
{
dbSetObjectFrame(NinjaObject, 25);
}
}
if(ClickAbleText( 0, 45, "Die"))
{
if(dbObjectFrame(NinjaObject) < 51)
{
dbSetObjectFrame(NinjaObject, 51);
}
}
However this give me a laggy animation on the last frame of the ninja model.
The model used is: media\\models\\People\\Ninja\\H-Ninja in the DarkMatter folder