Skip to content

Geometries get deformed because translation is applied too early #9

Description

@wlinna

cityjson-loader-broken-translation-handling

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 the translation afterwards to the position of loader.scene (or if there's a better root node, then that).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions