Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAnim skin deformation #7

Closed
andreasplesch opened this issue Jul 15, 2018 · 5 comments
Closed

HAnim skin deformation #7

andreasplesch opened this issue Jul 15, 2018 · 5 comments

Comments

@andreasplesch
Copy link

http://www.web3d.org/x3d/content/examples/Basic/HumanoidAnimation/JoeSkinTexcoordDisplacerKick.x3d

produces warnings and does not animate the skin in 3.18 on Windows.

BSContact displays as below and does not show warnings:

image

https://raw.githubusercontent.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/Lucy_test4.x3d

has inverted kinematics on Windows 3.18 but is correct on Linux 3.18.

@andreasplesch
Copy link
Author

BSContact renders the Lucy models also with inverted rotations, in the same way.

A first, very inefficient, x3dom skin deformation implementation also shows the same rotations:

https://rawgit.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/inlineloader.html

while the JoeKick mode is animated correctly.

So perhaps there is a problem with the Lucy model. Let me double check the Linux version of view3dscene.

@andreasplesch
Copy link
Author

andreasplesch commented Jul 16, 2018

It turns out that while view3dscene converted Lucy x3d model at

https://raw.githubusercontent.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/Lucy_test4.x3d

has the inverted rotations,

the original vrml model at

http://www.seamless3d.com/browser_test/lucy_test4.x3dvz

is correct.

So there seems to be an issue with the view3dscene vrml to x3d conversion. See #8 .

@andreasplesch
Copy link
Author

It turns out the JoeSkin example has not enough texCoords for a vertices. Here is a fixed version:

https://raw.githubusercontent.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/JoeSkinTexcoordDisplacerKick.x3d

view3dscene does not produce any more warnings and displays the texture animation but does not animate the skin.

@michaliskambi
Copy link
Member

Sorry it took so long to address this!

Indeed the https://raw.githubusercontent.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/JoeSkinTexcoordDisplacerKick.x3d does not animate. That is because it doesn't list the joints in the HAnimHumanoid.joints list.

It is an error in X3D as far as I know -- https://www.web3d.org/documents/specifications/19774-1/V2.0/Architecture/ObjectInterfaces.html#Humanoid says """The joints field contains a list of references, one for each Joint object defined within the skeleton field hierarchy of the Humanoid object."""

  1. That said, it seems like an easy mistake to make (I recall a similar problem reported earlier), and surprising (CGE is silent about it, and just doesn't animate; other X3D viewers seem to not rely on HAnimHumanoid.joints).

    So I fixed Castle Game Engine (and thus view3dscene) to fix it automatically.

    Upon opening unmodified https://raw.githubusercontent.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/JoeSkinTexcoordDisplacerKick.x3d with latest view3dscene (from snapshots on https://castle-engine.io/view3dscene.php , give them ~1 hour from now to be rebuild) you will now see warning

    HAnimHumanoid.joints list was empty, fixed to list all 94 joints
    

    and it will animate OK.

  2. Note: I found a different version of the same model on https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Legacy/ , more precisely https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Legacy/JoeSkinTexcoordDisplacerKick.x3d . Skin animation worked there OK, even before fix in AD 1. I found it has:

        <HAnimJoint USE='Joe_HumanoidRoot' containerField='joints'/>
        <HAnimJoint USE='Joe_sacroiliac' containerField='joints'/>
        <HAnimJoint USE='Joe_vl5' containerField='joints'/>
        <HAnimJoint USE='Joe_vl4' containerField='joints'/>
        <HAnimJoint USE='Joe_vl3' containerField='joints'/>
        <HAnimJoint USE='Joe_vl2' containerField='joints'/>
        <HAnimJoint USE='Joe_vl1' containerField='joints'/>
        <HAnimJoint USE='Joe_vt12' containerField='joints'/>
        <HAnimJoint USE='Joe_vt11' containerField='joints'/>
        <HAnimJoint USE='Joe_vt10' containerField='joints'/>
        <HAnimJoint USE='Joe_vt9' containerField='joints'/>
        <HAnimJoint USE='Joe_vt8' containerField='joints'/>
        <HAnimJoint USE='Joe_vt7' containerField='joints'/>
        <HAnimJoint USE='Joe_vt6' containerField='joints'/>
        <HAnimJoint USE='Joe_vt5' containerField='joints'/>
        <HAnimJoint USE='Joe_vt4' containerField='joints'/>
        <HAnimJoint USE='Joe_vt3' containerField='joints'/>
        <HAnimJoint USE='Joe_vt2' containerField='joints'/>
        <HAnimJoint USE='Joe_vt1' containerField='joints'/>
        <HAnimJoint USE='Joe_vc7' containerField='joints'/>
        <HAnimJoint USE='Joe_vc6' containerField='joints'/>
        <HAnimJoint USE='Joe_vc5' containerField='joints'/>
        <HAnimJoint USE='Joe_vc4' containerField='joints'/>
        <HAnimJoint USE='Joe_vc3' containerField='joints'/>
        <HAnimJoint USE='Joe_vc2' containerField='joints'/>
        <HAnimJoint USE='Joe_vc1' containerField='joints'/>
        <HAnimJoint USE='Joe_skullbase' containerField='joints'/>
        <HAnimJoint USE='Joe_temporomandibular' containerField='joints'/>
        <HAnimJoint USE='Joe_l_acromioclavicular' containerField='joints'/>
        <HAnimJoint USE='Joe_r_acromioclavicular' containerField='joints'/>
        <HAnimJoint USE='Joe_l_ankle' containerField='joints'/>
        <HAnimJoint USE='Joe_r_ankle' containerField='joints'/>
        <HAnimJoint USE='Joe_l_elbow' containerField='joints'/>
        <HAnimJoint USE='Joe_r_elbow' containerField='joints'/>
        <HAnimJoint USE='Joe_l_eyeball_joint' containerField='joints'/>
        <HAnimJoint USE='Joe_r_eyeball_joint' containerField='joints'/>
        <HAnimJoint USE='Joe_l_eyebrow_joint' containerField='joints'/>
        <HAnimJoint USE='Joe_r_eyebrow_joint' containerField='joints'/>
        <HAnimJoint USE='Joe_l_eyelid_joint' containerField='joints'/>
        <HAnimJoint USE='Joe_r_eyelid_joint' containerField='joints'/>
        <HAnimJoint USE='Joe_l_hip' containerField='joints'/>
        <HAnimJoint USE='Joe_r_hip' containerField='joints'/>
        <HAnimJoint USE='Joe_l_index0' containerField='joints'/>
        <HAnimJoint USE='Joe_r_index0' containerField='joints'/>
        <HAnimJoint USE='Joe_l_index1' containerField='joints'/>
        <HAnimJoint USE='Joe_r_index1' containerField='joints'/>
        <HAnimJoint USE='Joe_l_index2' containerField='joints'/>
        <HAnimJoint USE='Joe_r_index2' containerField='joints'/>
        <HAnimJoint USE='Joe_l_index3' containerField='joints'/>
        <HAnimJoint USE='Joe_r_index3' containerField='joints'/>
        <HAnimJoint USE='Joe_l_knee' containerField='joints'/>
        <HAnimJoint USE='Joe_r_knee' containerField='joints'/>
        <HAnimJoint USE='Joe_l_metatarsal' containerField='joints'/>
        <HAnimJoint USE='Joe_r_metatarsal' containerField='joints'/>
        <HAnimJoint USE='Joe_l_middle0' containerField='joints'/>
        <HAnimJoint USE='Joe_r_middle0' containerField='joints'/>
        <HAnimJoint USE='Joe_l_middle1' containerField='joints'/>
        <HAnimJoint USE='Joe_r_middle1' containerField='joints'/>
        <HAnimJoint USE='Joe_l_middle2' containerField='joints'/>
        <HAnimJoint USE='Joe_r_middle2' containerField='joints'/>
        <HAnimJoint USE='Joe_l_middle3' containerField='joints'/>
        <HAnimJoint USE='Joe_r_middle3' containerField='joints'/>
        <HAnimJoint USE='Joe_l_midtarsal' containerField='joints'/>
        <HAnimJoint USE='Joe_r_midtarsal' containerField='joints'/>
        <HAnimJoint USE='Joe_l_pinky0' containerField='joints'/>
        <HAnimJoint USE='Joe_r_pinky0' containerField='joints'/>
        <HAnimJoint USE='Joe_l_pinky1' containerField='joints'/>
        <HAnimJoint USE='Joe_r_pinky1' containerField='joints'/>
        <HAnimJoint USE='Joe_l_pinky2' containerField='joints'/>
        <HAnimJoint USE='Joe_r_pinky2' containerField='joints'/>
        <HAnimJoint USE='Joe_l_pinky3' containerField='joints'/>
        <HAnimJoint USE='Joe_r_pinky3' containerField='joints'/>
        <HAnimJoint USE='Joe_l_ring0' containerField='joints'/>
        <HAnimJoint USE='Joe_r_ring0' containerField='joints'/>
        <HAnimJoint USE='Joe_l_ring1' containerField='joints'/>
        <HAnimJoint USE='Joe_r_ring1' containerField='joints'/>
        <HAnimJoint USE='Joe_l_ring2' containerField='joints'/>
        <HAnimJoint USE='Joe_r_ring2' containerField='joints'/>
        <HAnimJoint USE='Joe_l_ring3' containerField='joints'/>
        <HAnimJoint USE='Joe_r_ring3' containerField='joints'/>
        <HAnimJoint USE='Joe_l_shoulder' containerField='joints'/>
        <HAnimJoint USE='Joe_r_shoulder' containerField='joints'/>
        <HAnimJoint USE='Joe_l_sternoclavicular' containerField='joints'/>
        <HAnimJoint USE='Joe_r_sternoclavicular' containerField='joints'/>
        <HAnimJoint USE='Joe_l_subtalar' containerField='joints'/>
        <HAnimJoint USE='Joe_r_subtalar' containerField='joints'/>
        <HAnimJoint USE='Joe_l_thumb1' containerField='joints'/>
        <HAnimJoint USE='Joe_r_thumb1' containerField='joints'/>
        <HAnimJoint USE='Joe_l_thumb2' containerField='joints'/>
        <HAnimJoint USE='Joe_r_thumb2' containerField='joints'/>
        <HAnimJoint USE='Joe_l_thumb3' containerField='joints'/>
        <HAnimJoint USE='Joe_r_thumb3' containerField='joints'/>
        <HAnimJoint USE='Joe_l_wrist' containerField='joints'/>
        <HAnimJoint USE='Joe_r_wrist' containerField='joints'/>

right before

      </HAnimHumanoid>

Adding these joints to your https://raw.githubusercontent.com/andreasplesch/x3dom/HAnim_work/test/functional/HAnim/JoeSkinTexcoordDisplacerKick.x3d fixes the problem also, even for older view3dscene.

@andreasplesch
Copy link
Author

Thanks. Unfortunately, I do not remember if I got the .x3d with the missing joints field from Joe. I do seem to remember asking about the field on the mailing list as it is redundant, and I think the response was that it needs to be populated for a pretty printer to function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants