Jump to content

question regarding skeletonViewer position and attachToBone scale


amo yeh
 Share

Recommended Posts

Two questions I would like to ask for this great library.

Here is a scene I made with 3ds max, I used biped and exported as animation, http://www.babylonjs-playground.com/#2AMWUJ#0

1. The model world position changes on this animation. I noticed that skeletonViewer is not following the animation position, is this correct or I missed something?

2. I used attachToBone to attach a box on the head, how to affect only the position and rotation but not scale on this box? 

Thanks any one who knows the above 

Link to comment
Share on other sites

1.  The model isn't technically changing world position.  You have rotation & translation on the root bone.  Apparently skeleton viewer does not take that into account.  It is better to move & rotate the meshes as a separate animation.  That way, the mesh'es permanent position is accurate.  The skeleton viewer is just a developer tool.

2. Kind of an all or nothing thing.

Link to comment
Share on other sites

Thanks JCPalmer for pointing out the root bone concept. 
The scene we are making only contains static animation with people dancing around, I guess it is fine to move the root bone. I will keep this concept in mind for making interactive characters, since mesh position matters. 
   

Adam that was great response with the demo code, really appreciated for the help, I will dig some more on the needInitialSkinMatrix and see how that works.
as for the attachToBone question, I guess I can always get the bone position and rotation and update my mesh manually? The version 2.5 Bone.getAbsolutePosition and other related function looks promising, will try it and see how that works.

Link to comment
Share on other sites

15 minutes ago, amo yeh said:

I guess I can always get the bone position and rotation and update my mesh manually? The version 2.5 Bone.getAbsolutePosition and other related function looks promising, will try it and see how that works.

There currently isn't a getRotation function for bone.  I can probably add that this weekend.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...