Open wlinna opened 6 months ago
The other issue where I just mentioned in cityjson-threejs-loader is very similar. I also posted a side-by-side comparison image there.
The files have different translations from the ones posted here, which leads to slightly different deformities.
Describe the bug cjio exports tend to become very inaccurate once translation is involded.
My suspicion is that it is caused by cjio calling
self.decompress
before computing normals, triangulating etc. The problem would likely go away if only the scale was applied before computations, and then the translation was applied as a final step. In the case of glTF, the translation should be set for the node. In the case of OBJ, the translation should be applied to each vertex.cjio version I tried both the master and develop branches
To Reproduce Prerequisite: you have
cjio
in yourPATH
repro.zip
cjio simplified.city.json export glb simplified.glb
cjio simplified_translated.city.json export glb simplified_translated.glb
I also tested OBJ, and the problem is basically the same. (The reason why we must take so many steps to view the file is because the translation is applied to vertex coordinates instead of setting it for the node)
Expected behavior The resulting geometry should not deform.
(Also, as a side note, the GLB should have the translation applied to its root node, not at geometry level. The viewers have much easier time handling such models)
Screenshots
Desktop (please complete the following information):
Additional context This happens with real-life models. This is just a simplified version with made-up coordinates, but the problem is the same.