Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No documentation on calculating global joint transformations #1630

Closed
scgehin opened this issue Jun 17, 2019 · 7 comments
Closed

No documentation on calculating global joint transformations #1630

scgehin opened this issue Jun 17, 2019 · 7 comments

Comments

@scgehin
Copy link

scgehin commented Jun 17, 2019

The quick reference sheet, specification readme, and tutorial all fail to mention how to calculate the global joint transformations. This has caused me a lot of trouble that could have been easily avoided.
The quick reference sheet only states "For each node whose index appears in the joints of the skin, a global transform matrix can be computed." This is extremely unhelpful. The other two resources I mentioned fail to mention the global joint transforms at all.
I'd greatly appreciate it if the quick reference sheet at the very least could explain how to calculate it properly.

@vpenades
Copy link
Contributor

Calculating the global transform is a standard procedure.

Every node in the scene has a transform calculated using the rotation, translation and scaling of the node. This transform is sometimes called "the local transform"

The global transform of a node, also called "the world transform", is just the local transform of the node, multiplied by the world transform of its parent.

So essentially, a node has both a local and a world transform. The skinning system just states that you should use the world (global) transform of the node, not the local transform.

@scurest
Copy link

scurest commented Jun 20, 2019

Cf #1035.

@javagl
Copy link
Contributor

javagl commented Nov 4, 2019

As vpenades mentioned above: The phrase "global transform of a node" basically means: "The product of all local transforms on the path between the root and the respective node" - that's also how it is explained in https://github.com/javagl/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_004_ScenesNodes.md#global-transforms-of-nodes (and in the quick reference sheet / overview).


Could a minor rewording solve the issue? :

The global transform of a node is given by the product of all local transforms on the path from the root to the respective node

(In the nodes section, making it bold to make clear that this is a coined term)

...

For each node whose index appears in the joints of the skin, a the global transform matrix can be computed

(In the skinning section, saying "the" instead of "a", and also making it bold)

Otherwise, it could be rephrased (in the overview and tutorial) to something like

For each node whose index appears in the joints of the skin, the global transform matrix can be computed, as described in [link:] the section about Nodes

@javagl
Copy link
Contributor

javagl commented Dec 17, 2019

@scgehin The overview contains the statements

"For each node whose index appears in the joints of the skin, a global transform matrix can be computed."

and

"The global transform of a node is given by the product of all local transforms on the path from the root to the respective node."

Do you think that making the words "global transform" bold (and thus, making them a "coined term") could resolve the issue?

Otherwise, any hints about how to resolve this issue would be appreciated.

@vpenades
Copy link
Contributor

A global transform AKA world transform, is the matrix that transforms a mesh to world space.

A local, or relative, transform is the transform of a node relative to its parent node (if any).

Typically a scene graph node stores its local transform, and you calculate its world/global transform by concatenating the local transforms of every node down to the root node/scene.

@javagl these are very basic operations when dealing with scene graphs in 3D space, that is, converting from local to world and from world to local, and they're not specific of glTF, but a standard in the 3D industry, and available in pretty much every 3D format that has a scene graph. That's why I guess nobody considered adding documentation for it.

@javagl
Copy link
Contributor

javagl commented Dec 18, 2019

@vpenades That was roughly what I thought, but I'd hesitate to close this issue iff there is something in the spec that should be clarified, or something in the overview that should be improved. But unless there is further activity, recommendations or comments, I'd close this issue soon.

@lexaknyazev
Copy link
Member

Both global and joint-specific node transforms have been clarified in the AsciiDoc spec release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants