i can run this demo
skeleonViewer can draw correct bone line(or changeDisplayMode() ).
but when using my own code, the viewer’s result is magnified 100 times, and it is lying down. Do you need further assistance or explanation?
i use TS, npm install latest babylonjs(7.49.0)
and code here:
SceneLoader.ImportMeshAsync("", "models/", "tpose_xmodel.glb", this.scene).then((result) => { const { meshes, particleSystems, skeletons, animationGroups } = result; this.animationGroups = animationGroups; var xBotRoot = meshes[0]; var xBotSkeleton = skeletons[0]; xBotRoot.name = "~xBot"; xBotRoot.scaling = new Vector3(0.1, 0.1, 0.1); xBotRoot.position = new Vector3(0, 0, 0); xBotRoot.rotate(Vector3.Up(), Math.PI / 2); const viewer = new SkeletonViewer(xBotSkeleton, xBotRoot, this.scene); viewer.isEnabled = true; viewer.color = Color3.Red(); viewer.update(); // viewer.changeDisplayMode(0); xBotRoot.receiveShadows = true; shadowGenerator.addShadowCaster(xBotRoot); console.log(`Skeleton:`, xBotSkeleton.name); xBotSkeleton.bones.forEach((bone, bIdx) => { console.log(`Bone #${bIdx}: ${bone.name}`); }); });