3D Model - how to get coordinates of certain part of the model?

Not favoritedFavorited Favorited 0 favourites
  • 5 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • "3D Model" plugin looks very promising, but unlike Mikal's classic 3D Object plugin, individual bone nodes or sub-meshes aren't directly exposed as accessible reference points inside the event sheet.

    In short - how can I get coordinates of particular mesh or bone within the 3D object? I want to, for example, place soccer ball exactly in goalkeeper's hand, or a hat on main character's head (and make it stay there).

    If I knew coordinates of desired mesh or bone, I could update the position of the smaller object with every tick. But I don't.

    Something like 3DModel.MeshAt(1).X or 3DModel.Mesh("hand").X would be great.

  • Nice feature request. But in the meantime you could build the model with those objects and toggle their visibility.

    Another idea could be to load the glb/gltf file directly and parse out the skeleton and animation data, then transform that to match the 3dmodel. It works but in my tests making a glb loader I haven’t been able to get the Skelton to perfectly match the 3dmodel yet.

  • Thanks for the explanation, really appreciated. The separate GLTF parsing approach sounds very interesting, although probably a bit too advanced/fragile for my current needs 🙂

    I ended up submitting a formal feature request for exposing bone/node/mesh transforms in the official 3D Model plugin, since it would solve a lot of gameplay-related use cases cleanly:

    github.com/Scirra/Construct-feature-requests/issues/798

    Thanks again for the ideas and insights!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You only need to access node transforms. Objects and bones are just nodes in glb files.

  • I made a behavior that exposes the bones at runtime so that you can get their position and rotation data. It includes an attach and detach action so that you can parent objects to them as well.

    Download here drive.google.com/file/d/1XugXwyaoxIJza-fSTmQa4NNVEOpFO6JU/view

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)