Coder Social home page Coder Social logo

Comments (7)

dakom avatar dakom commented on July 17, 2024

Along with the language of the tutorial, if the above is correct then I believe it would also mean changing this pseudocode:

jointMatrix(j) =
  globalTransformOfNodeThatTheMeshIsAttachedTo^-1 *
  globalTransformOfJointNode(j) *
  inverseBindMatrixForJoint(j);

to rather be:

jointMatrix(j) =
  globalTransformOfSkeletonRootNode^-1 *
  globalTransformOfJointNode(j) *
  inverseBindMatrixForJoint(j);

I'm not quite clear on what to do in the case where there is no skeleton root node... e.g. whether it should be:

jointMatrix(j) =
  globalTransformOfJointNode(j) *
  inverseBindMatrixForJoint(j);

or in this particular case, the skeletonRootNode is the mesh node...
?

from gltf-tutorials.

shrinktofit avatar shrinktofit commented on July 17, 2024

I have the same question.

I don't know the meaning of skin.skeleton and how does it effect the calculation of the joint matrix.

In my case, I simply ignore it and do follow the tutorial gltfTutorial_020_Skins and everything seems OK.

from gltf-tutorials.

emackey avatar emackey commented on July 17, 2024

@donmccurdy Do you know the answer, or the right person to ask?

from gltf-tutorials.

emackey avatar emackey commented on July 17, 2024

/cc KhronosGroup/glTF#1270

from gltf-tutorials.

donmccurdy avatar donmccurdy commented on July 17, 2024

Just replied on KhronosGroup/glTF#1270. I believe it is correct to ignore it.

from gltf-tutorials.

emackey avatar emackey commented on July 17, 2024

Having learned a bit more about skinning this year, I believe the tutorial's pseudocode is correct.

The vertex shader that's drawing a skinned mesh will attempt to draw it wherever in the world the node that owns the skinned mesh is located. But the mesh isn't supposed to be there, instead the mesh is supposed to be wrapped around the bones, which might be completely elsewhere. So the transform needs the inverse of the skinned mesh node's position, to recover the glTF "world" coordinates, and from there must travel to the joint's world coordinates.

The skeleton node is safe for implementations to ignore, and safe to omit from glTF. I believe it serves as a marker between full-fledged heavyweight scene nodes, versus lighter-weight no-mesh-allowed joint nodes. I believe it's purely a performance optimization, or a crutch for systems that demand to draw a sharp distinction between nodes and joints.

from gltf-tutorials.

javagl avatar javagl commented on July 17, 2024

I think that, after a longer discussion and various fixes, this should also be resolved as of #64

If it is not, feel free to reopen.

from gltf-tutorials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.