Hi together,
I'm working on a skeletal-animation framework at the moment. Everything works
fine, except I cannot move a bone without distorting my skin "before" I add
the bone-influences to the mesh.
Bone upperBodyBone = new Bone("UpperBodyBone");
mySkin.setSkeleton(upperBodyBone);
mySkin.setSkin((Geometry) pObjSpatial);
int[] upperBodySkinIndizes = calculateSkinVerts(pObjSpatial, myBvhReader.getSkeleton().getSkeletonData().getAllVertices());
int[] headSkinIndizes = calculateSkinVerts(pObjSpatial, myBvhReader.getSkeleton().getSkeletonData().getHeadVertices());
int[] neckSkinIndizes = calculateSkinVerts(pObjSpatial, myBvhReader.getSkeleton().getSkeletonData().getNeckVertices());
makeSkinFromMesh(mySkin, upperBodySkinIndizes, null, upperBodyBone);
Bone neckBone = new Bone("NeckBone");
float[] neckJoint = myBvhReader.getNeckJoint();
neckBone.setLocalTranslation(neckJoint[0], neckJoint[1], neckJoint[2]);
makeSkinFromMesh(mySkin, neckSkinIndizes, null, neckBone);
Bone headBone = new Bone("HeadBone");
float[] headJoint = myBvhReader.getHeadJoint();
headBone.setLocalTranslation(headJoint[0], headJoint[1], headJoint[2]);
makeSkinFromMesh(mySkin, headSkinIndizes, null, headBone);
neckBone.attachChild(headBone);
upperBodyBone.attachChild(neckBone);
The upperBodyBone influences all Vertices in the Mesh. neckBone and headBone
have their own influences. Why does headBone deform the Mesh after
headBone.setLocalTranslation(... ); without having influences in the mesh yet?
Is there a possibilty to move Bones in a already skinned mesh, without influencing
the mesh itself?