Original Post
How do i find the new values of my normal after i have deformed my mesh using skeletal animation?
Do i have to calculate a new matrix? Or can i just use the same matrix as i did to find the vertex positions?
Im doing something like this now
if(temp.bone[u].parentPtr)
{
//rmat refers to the rotation matrix
//tmat originally refers to the inverse of the bones XYZ position to move the bone to the origin before doing rotation.
//fmat is a temporary matrix
//temp.bone[u].mat is the matrix where the final matrix to be used is stored
multMat(rmat,tmat,fmat);//translate to origin, followed by rotation
//find a new tmat which returns bone back to its position
tmat[12] = temp.bone[u].x;
tmat[13] = temp.bone[u].y;
tmat[14] = temp.bone[u].z;
//apply the tmat to the fmat to return the bone back
multMat(tmat,fmat,rmat);
//apply parents matrix after local is done
multMat(temp.bone[u].parentPtr->mat,rmat,temp.bone[u].mat);
}
[edited by - GamerSg on January 9, 2004 10:32:27 AM]