How make the character's feet touch the gound?

Hi,
I’ve been strugling against a wield thing: after loading mesh to my scene, I was just not able to let the character’s feet touch the ground plane.

when a character come from loading, it always put its position at point(0,0,0). so the character seems to be buried half in the gournd.

so , now I need to lift the character up above the ground .but how?
some PG shows that a box can lift up by its size/2. that’s good . but how to deal with a mesh ? Is there a method to get he distance between the mesh’s feet and the ground?

the attached pictures show my sitution:


when I drag the gltf in the sand box , it shows the bouding box are is not exactly encompose the role.

the attached picture here is when loading into my scene, the character is “buried” .

Hello! you have 2 options::

  • Edit your mesh in your DCC tools to move the pivot on his feet
  • call the mesh.setPivotMatrix() API in Babylon.js
1 Like

really thanks , I’ll try both options

I open my 3ds max 2018 and checked the bounding boxes of these characters, it seems the bounding boxes are exactly correct. could it be a bug of Babylonjs 3ds exporter plugin ?

bj00.zip (1.7 MB) zz00.zip (1.5 MB)

Pinging @drigax :slight_smile:

Off the top of my head: Max doesn’t make it easy to change the origin of a mesh, Most likely the characters are offset from the ground in your max scene, and may need a dummy node so that the offset is preserved when placed on ground… I’ll have to take a closer look when I get some time in a few hours.

@moxierichard

Looks like that’s the case. your character’s root bone is not at the scene root, so the offset gets lost after you set it to the origin. You can fix this by adding an additional root bone that is at the origin, and parenting the rest of your rig to that:

1 Like

thanks very much.
I’m not sure I really understand what you mean. Is it point(0,0,0) of what you said about Scene Root ? I checked babylons 3ds max exporter document that does not mention about this .
so babylonjs 3ds max in fact supposes every model is positioned at (0,0,0) before exporting ,

currently I have 8 max with each the character has an animation . all of the animations are standing above the ground.

So I have to update every max files that I have to low down the center of the model,rather than the BIP001, to be at (0,0,0), do’n’t I ?
Meanwhile, the BIP001(all animations are bound to skeletons which has the common father BIP001) needs to be low down as well?

The model appears to be in the proper position when exported, you can see by the bounding box in the sandbox. The issue is that our skeleton root is considered to be at 0,0,0 due to the schema. I’m looking at our exported glTF, it appears that our Bip001 bone is missing from the scene…this may be why we’re being teleported inside the origin…this Bip001 bone contains the offset from origin for the rest of the skeleton…

Understood now.
thanks a lot!

No problem. here’s the bug that I’m working on currently regarding this:

Fix should be available now, thanks for reporting!:

1 Like

thanks for your time and work!
so I need to download the new babylon 3ds max exporter version? where ?

Hi, Drigax:
one more question about exporting animation groups.
I have a model role and 243 frames of animation to show his actions , and already grouped these frames into different animation groups( including idle,jog,kick,fall,strike,push ) in order to export as a gltf file and to finally load into my scene.
where I performs these animations in 3ds Max, it seems everything is OK. so I exported these to gltf using the Babylon 3ds Max exporter.

But the exporting result is not satisfied, when I review the export output in the online SandBox, I found that only the animGrp of idle and jog are nomal.But other animgroups, such as kick, fall, push and strike , looks wierd. The common problems are that the legs are floating in air ,waving, without a landing point…looks really funny. Here I list the max files, and some videos for your reference, I need your help. any reply will be really appreciated.Uploading: 3ds Max-animGrp-animGrp-kick-from 48 to 78.mp4…

role-zz-3ds max.zip (1.5 MB)

This character is beautifull !!! @Drigax I count on you cause I really want to try out what @moxierichard is building :slight_smile:

@moxierichard you can install the latest exporter by following these instructions. We have an installer program you can use to install the exporter in one click:

https://doc.babylonjs.com/resources/3dsmax#how-to-install-the-3ds-max-plugin

Can you reupload the max file? this latest one only has idle and run animations, no punch or kick… :thinking:

OK, I will send you nowzz-copy.zip (303.9 KB)
and thanks for your 3ds exporter which can export animation groups settings so anyone can reload these animation group settings easily. zz_animGrp_all.zip (3.5 KB)