Original Post
I've found a source code for a model viewer but it is ridiculously slow. I get 50fps(80fps w/o animation) for a model with 5458 triangles and animation. My computer spec is Athlon XP 2400 256 DDR RAM Geforce4Ti4200 DDR 128MB Here's the updating part. Is there any problems?
HRESULT CRenderObject::UpdateVB(MOV_STATE State)
{
m_MovState = State;
int j = 0;
if(State==MOV_IDLE){
for(int k=0; k<(int)(m_Triangle.size()); ++k)
{
SX_SKELETON_REF * pRef;
for(int i=0; i<3; ++i)
{
int iNode = m_Triangle[k].sxVtx.iNode;
pRef = &(m_SkelAct[m_iCurrAnim][m_iFrameID].paRef[iNode]);
m_paVertex[j++].position = Multiply(m_Triangle[k].sxVtx.OrgVertex.position, &(pRef->matTransform))+pRef->NewPivot;
}
}
}else{
for(int k=0; k<(int)(m_Triangle.size()); ++k)
{
SX_SKELETON_REF * pRef;
for(int i=0; i<3; ++i)
{
int iNode = m_Triangle[k].sxVtx.iNode;
if(iNode>73||iNode<4) pRef = &(m_SkelAct[m_iCurrMovAnim][m_iMovFrameID].paRef[iNode]);
else if(iNode<74&&iNode>3) pRef = &(m_SkelAct[m_iCurrAnim][m_iFrameID].paRef[iNode]);
//m_paVertex[j].normal = Multiply(m_Triangle[k].sxVtx.OrgVertex.normal, &(pRef->matTransform));
m_paVertex[j++].position = Multiply(m_Triangle[k].sxVtx.OrgVertex.position, &(pRef->matTransform))+pRef->NewPivot;
}
}
}
if(FAILED(SetVB()))//Releases vertices to VB
return E_FAIL;
return S_OK;
}