-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Inconsistent behavior with ModelGraphics.nodeTransformations #7615
Comments
Currently we have found work around to this problem in how models are rigged before exporting to glTF. While the inconsistent behavior is still a bit of a headache I think this can be resolved through better documentation and/or guidelines when bringing glTF models into Cesium. |
@lilleyse thoughts? |
@richard3d I know you mentioned you found a workaround in the forum thread as well, but I don't think you ever described what it was. Can you explain what your workaround was when rigging the model before exporting it to Cesium? It'll give us some more insight into what I believe is a bug in resolving the orientation of child/parents during animations. And just to close the loop, for anyone else running into similar problems, Richard has made a small library on top of Cesium for giving you greater control over animations outside the timeline: Forum thread: https://groups.google.com/d/msg/cesium-dev/wOXc8MQL40A/An9TnWeBAQAJ It seems to work pretty well from my tests! |
Hey everyone sorry for the late response but I wanted to run some more tests to give the best information possible. After working with @OmarShehata and analyzing some other gltf models, I have come to the conclusion that I mistakenly described the problem due to the original model I was working with. It seems the TRS behavior of
I am curious to hear any feedback on these suggestions. I will close this issue shortly (since it is misleading/not relevant at this point) and create other ones for the improvements listed. You can see a full demo of my current work here: https://cesium-modelanimationplayer.glitch.me/ |
Congratulations on closing the issue! I found these Cesium forum links in the comments above: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/-3uqvsuF06I If this issue affects any of these threads, please post a comment like the following:
|
Just to make sure I understand the problem I drew a picture of what the different transforms look like. Is it that you expect the second image while Cesium does the third? My interpretation of the glTF spec is that transforms are always in a local coordinate system, not relative to their parent: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#transformations
I'd be curious in seeing what ThreeJS or BablyonJS do here. |
I think there needs to be some more clarifying information before I answer:
Based on this info and assuming the parent box is a unit cube and has axes +y running up vertically with your drawing, +x to the right..etc. I would interpret
The BabylonJS Sandbox is what originally lead me to these conclusions. If you load this file (.glb in the zip) in the editor and rotate the node Again, Cesium does not necessarily perform node transformations (in ModelGraphics) incorrectly, it just does it in a different space i.e. relative to the node's original TRS than I expected. If you think I am also mis-interpreting the spec please let me know! . |
Hi guys. I don't think the glTF spec says anything about clients' application of their own node transforms to the model, be they replacements or in addition to existing node transforms. But I do want to point out the "original matrix" logic will change slightly in a PR I currently have open, #7835. Prior to this PR, the In this PR, the storing of "originals" changes to be on the I don't know if this will have any implications for your use here. Hopefully not, but it might make the |
@emackey I agree with what you said regarding the spec:
I don't think your work will affect my usage currently. This issue came about due to my assumption that node transformations for |
Okay I think we are in agreement then. If someone sets these values to I have nothing else to add then, except that in the future we may to consider changing |
I'm not totally on board with the need for that. Obviously we can't break existing use of nodeTransforms. But aside from the compatibility concerns, I think it makes some sense to transform a node in its own coordinate system. If you really need the parent's system, just remove the static transform from the glTF file, and apply that as the starting nodeTransform instead. Also, now that articulations are starting to join this party, I'm hoping to encourage users to ramp up on that instead of nodeTransforms. We don't have it in CZML yet, but that's coming. Articulations can automate certain tasks, like spinning all wheels at once, or causing two halves of a payload fairing to separate, or multiple segments of a solar panel to deploy at the same time, etc. A certain commercial launch vendor (not sure if I'm allowed to name them here) has been using articulations driven by realtime telemetry from launches for many, many years, in STK. Articulations are applied in the node's local system, after any model-supplied static node transforms. |
Depending on how comfortable we are with bridging the entity and primitive APIs, another option would be to add a |
I have an entity that I have defined along with a glTF model. There is a single animation that exists in the file but I disable it by default (
runAnimations: false
). I have noticed an odd behavior in particular when translating nodes. If I translate a node that has no rotation animation keys defined, the node translates as expected relative to the parent node's local coordinate system i.e. a translation of 10,0,0 results in the node being moved ten units along the parent node's x-axis. However, when translating a node that has rotation keys defined, the transformation moves the node along its own x-axis rather than the parent's axis as expected. Again, the animation is totally disabled so its not like the timeline is overwriting the value or anything like that. I created a post in the mailing list asking about this behavior but have not received any responses. You can view the full history of the discovery hereThe text was updated successfully, but these errors were encountered: