glTF skins

Hello, i am currently learning about the glTF format and most of it makes sense except the Skins part
I am mostly confused about the joints array, what data is written there?
this is an example from the gltf tutorial about skins

  "skins" : [ 
   {
    "inverseBindMatrices" : 4,
    "joints" : [ 1, 2 ]
   }
  ],

and i don’t understand what the ‘1’ and ‘2’ refer to
also how is a joint defined in glTF?
from the specification:
The skin contains an array called `joints` , which lists the indices of the nodes that define the skeleton hierarchy.
but i don’t entirely get what that means so any explanation would be appreciated

First, before everyone dives too deeply into the format, is there a reason you aren’t just using the built in support for reading GLTF in JME?

1 Like

Yes, because i have a custom model format that i first need to convert to glTF, therefore i need to write my own glTF exporter(and i’ve made really good progress, only thing left is animations) before i can import those models in JME

Your best bet is to look at the JME code that reads the format.

It may be difficult to reverse engineer “how to write XYZ” from “how we read XYZ”… but that’s the direction any of the JME GLTF experts would be coming from, too. We never had to write it, only read it… and usually we tried to make sure JME could read the canonical examples, things exported from Blender as GLTF, and GLTF files downloaded from sketchfab. (Not necessarily in that order since the original author of our GLTF support has moved on and now works at Sketchfab.)

Personally, the animation+skinning stuff is that part of GLTF that I’m least familiar with.

Okay thanks, i guess i’ll just try to figure it out from the GLTF specification.

If you change your mind the source code is here:

Thanks, i did look at the source code briefly but it seems kinda complicated to reverse engineer.

It’s kind of true.

If it were me, I’d probably be attacking from multiple fronts. On one side, I’d have a simple model open in Blender to look at what it produces for scenarios common to my own format. On the other side, I’d have the JME source open to try to figure out how it’s interpreting said data.

I’ve written my own GLTF importer for a Vulkan engine I am/was working on (when time allows it), which includes animations.

A HUGE help was the following image/documentation from Khronos itself:

Everything that you need is in there. The only thing that is not described very well are morphTargets, but I assume you won’t need them.

6 Likes

Yeah that helped a fair bit, but their tutorial helped me the most and i mostly have it all figured out now

2 Likes