-
Notifications
You must be signed in to change notification settings - Fork 10
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
Geometries get deformed because translation is applied too early #9
Comments
Hey @wlinna, Thanks for reporting the issue 🙌 I think this is already fixed by this: d6a9837. It's on the I still haven't released a version of ninja that contains this fix as I had some issue with building it and I need to find some time to resolve it. If you are using this library directly, you may think about switching to the |
Hello, thanks for the quick response. I was looking at that commit, and something that I found interesting is that it doesn't seem to care about the difference of Y and Z conventions between CityJSON and ThreeJS. I would have thought that the scales would be applied in the order of |
In this library, I do not transform the coordinates to Y-up. You can either use a transformation matrix to finally transform everything to Y-up, or you can set the camera to assume a Z-up coordinate system (see here). |
Okay, thanks for the clarification |
This is practically the same issue that cjio has. Geometries are deformed because the whole transform is applied very early in the process. This leads to floating point inaccuracies.
To reproduce the problem, load files in CityJSON Ninja (which uses cityjson-threejs-loader), and notice the difference. The test files are below
simplified2.city.json
simplified2_less_translation.city.json
My suggested solution is to only apply the scale from the
transform
at first, do all the processing normally, and then add thetranslation
afterwards to theposition
ofloader.scene
(or if there's a better root node, then that).The text was updated successfully, but these errors were encountered: