edit ISkinnedMesh vertices
Posted: Thu May 23, 2013 7:39 pm
hi
i want to load a directx skinned mesh file and animate it with bone and some times i need to edit position of vertices individually.
i use this code to change vertices position:
when i export only meshes code works good. but when i export mesh with bones this code does not do anything and vertices remain without any change.
any one know what is problem?
i want to load a directx skinned mesh file and animate it with bone and some times i need to edit position of vertices individually.
i use this code to change vertices position:
Code: Select all
ISkinnedMesh * BaseMesh=(ISkinnedMesh*)m_Scene->getMesh("tmp.X");
SMeshBuffer * buf= (SMeshBuffer *) BaseMesh->getMeshBuffer(bufnum);
const S3DVertex * v1=(S3DVertex *)buf->getVertices();
//const S3DVertex * v2=(S3DVertex *)TargetMorphs[MTInd]->getMeshBuffer(bufnum)->getVertices();
u16 i;
for(i=0;i<buf->getVertexCount();i++)
{
vector3df *vec1=(vector3df *)&v1[i].Pos;
vector3df *vec2=(vector3df *)&v2[i].Pos;
vector3df tmp;
tmp=vec2->getInterpolated(*vec1,weight);
vec1->set(tmp);
}
buf->recalculateBoundingBox();
any one know what is problem?