Hi community
I am encountering a strange issue since recently.
A model that looked always nice in cesium seems to have some inverted parts. The preview in ion looks ok, but in the main viewer, some parts look “inside-out”, see:
I suspect that this might be related to the fact that some parts possibly have negative scales & this was handled wrongly in cesium till the recent update introduced with the new gltf model class, see here…can you confirm this? Thx!
Thanks for reporting, @katz. Cesium ion’s preview is actually a few versions behind the latest CesiumJS release right now, so your assertion about this being caused by a recent CesiumJS update is almost certainly correct.
I tried out your model, and confirmed what you said here:
I suspect that this might be related to the fact that some parts possibly have negative scales & this was handled wrongly in cesium till the recent update introduced with the new gltf model class
This is correct. The plane had negative scales, and the old Model code had a bug and these details “canceled out”. Since then, we fixed the handling of negative scales to be compliant with the glTF 2.0 spec which is why you only see a visual difference now in recent versions of Cesium (1.97+)
Also if you’re looking to fix the model, a couple possible ways:
Remake the data to avoid using negative scales
Or for primitives that use negative scales, store the geometry with clockwise triangles to cancel out the scaling factor. This idea is based on this implementation note in the glTF spec