-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Update CHANGES for model orientation change #6738
Conversation
@lilleyse, thanks for the pull request! Maintainers, we have a signed CLA from @lilleyse, so you can review this at any time. I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
@lilleyse is this transformation something we apply runtime in Cesium or is it saved as part of the glTF? Can we have more specific instructions for how to make this change? I wouldn't know how to do it from what you wrote. |
It's saved into the glTF. I updated the wording, hopefully it is clearer now. |
Which one is the root node? Is it always Would something like "open up the source model in a model editor and rotate it to face the correct axis and re-convert it to glTF" be an alternate recommended solution? The instructions need to be clear to someone who has little to no understanding of the glTF spec. Asking someone to open the glTF in a text editor isn't a good solution for someone with less of a technical background. And it won't work at all if that matrix has a value already, right? |
@lilleyse @hpinkos is providing a client-side workaround for "wrong" models ok? It'd be more self-contained than, say, developers having to hand-edit the glTF or ask artists for new assets.
And then in the Primitive API users probably just need to premultiply a rotation onto the model matrix or something. |
I don't think a Cesium workaround is a good idea because the model is still "wrong". I'm with @lilleyse on this one. Cesium was incorrect before and that led to equally incorrect models. We should advise everyone to fix their models. |
Yeah, models that are definitely incorrect should be fixed. E.g. the ground vehicle was +X forward and was fixed to be +Z forward. I don't think I would consider @kladess's models in #6713 incorrect though... which is why I don't really like the suggestion in |
I still think we should have a client-side fix documented in some capacity. |
OK, if @lilleyse agrees with this I'm fine with it. |
e50145f
to
faaf328
Compare
faaf328
to
6c4ecdb
Compare
Updated. I tried to cover all the cases here, but didn't want to get too verbose. I linked back to this PR where we can provide more instructions if needed. |
CHANGES.md
Outdated
@@ -4,7 +4,9 @@ Change Log | |||
### 1.47 - 2018-07-02 | |||
|
|||
##### Breaking Changes :mega: | |||
* glTF 2.0 models corrected to face +Z forwards per specification. Internally Cesium uses +X as forward, so a new +Z to +X rotation was added for 2.0 models only. [#6632](https://github.com/AnalyticalGraphicsInc/cesium/pull/6632) | |||
* glTF 2.0 models corrected to face +Z forwards per specification. Internally Cesium uses +X as forward, so a new +Z to +X rotation was added for 2.0 models only. To fix models that are oriented incorrectly after this change: | |||
* If the model faces +X forwards update the glTF to face +Z forwards. This can be done by loading the glTF in a model editor and applying a -90 degree rotation about the Y-axis. Alternatively, add a new root node to the glTF node hierarchy whose `matrix` is `[0,0,1,0,0,1,0,0,-1,0,0,0,0,0,0,1]`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some modeling programs might have a different up/forward convention, so maybe it's better to specify something like a 90 degree clockwise rotation about the Up-axis
.
Thanks @likangning93, updated. |
Fixes #6713 by giving instructions about how to correct models that are rotated unexpectedly.