Hi all,
i created a class for my states like (menu, running, intro etc)
and i use a factory for my objects like (items, chars etc)
when i try to render my selected char in my viewport where the player selects his wanted char for the game (like the menu in RPG2) then i have a problem to render the character or better said the meshes.
The mesh is successfully loaded (checked witht the boolean from load) thereafter the skeleton is loaded.
Code:
// Load the Mesh
if( m_MeshBase.load( _strMesh.c_str() ) )
{
// We found the mesh now load the bones
m_cSkeleton.create(_strSkel.c_str(),1.8);
}
while doing the update the position from the skeleton is set to the wanted position (0,0,0) and just for the test i used MatrixIdentity.
Code:
m_cSkeleton.clear ().updateMatrix(Matrix().setRotateY(PI).move(Vec( 0.0,0,0)));
the rendering is a little different to normal.
The state_manager calles the rendering of the state this calles the static viewport_render() method of my class. there in i can do anything i want.
Code:
void CGAME_OBJECT_CHARACTER::Render( void )
{
// Render the blended things Matrix().setPos(Vec(m_sDB_OBJECT.fPosition_X, m_sDB_OBJECT.fPosition_Y, m_sDB_OBJECT.fPosition_Z))
switch(Renderer())
{
case RM_PREPARE:
m_MeshBase.draw( m_cSkeleton );
break;
case RM_BLEND :
case RM_PALETTE: break;
}
//m_MeshBase.draw( MatrixIdentity );
m_MeshBase.setRender().setBox();
// Render a box
Box( 0.5f ,Vec(0,0,0)).draw( RED );
Box( 1.0,Vec(m_sDB_OBJECT.fPosition_X, m_sDB_OBJECT.fPosition_Y, m_sDB_OBJECT.fPosition_Z)).draw(GREEN_DARK);
Box( 1.5,Vec(m_sDB_OBJECT.fPosition_X, m_sDB_OBJECT.fPosition_Y, m_sDB_OBJECT.fPosition_Z)).draw(GREEN_LIGHT);
Box( 2.0,Vec(m_sDB_OBJECT.fPosition_X, m_sDB_OBJECT.fPosition_Y, m_sDB_OBJECT.fPosition_Z)).draw(GREEN_LIGHT2);
}
the RM_PREPARE was called and the boxes for debug are rendered.
here is a screenshot.
any hints for me?
cu
Oliver