Advertisement
snake5

ss3d: skinned mesh matrix calculation

Nov 23rd, 2014
483
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. boneData = _R.AnimMesh.boneData;
  2. animmi.resizeSkinMatrixArray( map_size( boneData ) );
  3. i0 = boneData[0].inv_skin_offset;
  4. i1 = boneData[1].inv_skin_offset;
  5. o0 = boneData[0].bone_offset;
  6. o1 = boneData[1].bone_offset;
  7. r0 = mat4().rotateX(deg2rad(30));
  8. r1 = mat4().rotateX(deg2rad(60));
  9. f0 = mat4().multiply2( mat4().multiply2( i0, r0 ), o0 );
  10. f1 = mat4().multiply2( mat4().multiply2( mat4().multiply2( i1, r1 ), o1 ), f0 );
  11. animmi.setSkinMatrix( 0, f0 );
  12. animmi.setSkinMatrix( 1, f1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement