Collada units

  • Luca Vezzaro

    Luca Vezzaro - 2011-06-15


    thanks for this fantastic library, it really saved me a lot of work.

    I'm trying to figure out how to handle correctly units and coordinates systems in my pipeline. While playing around with SketchUp, I noticed that the unit conversion specified in the collada file is ignored and coordinates are imported in what I guess are inches. I see the collada loader is parsing the conversion factor but it never really uses it.

    I thought about trying to get that value from the loader manually, but I see the loader interface is not exported as part of the standard includes, so I guess my only chance would be to modify the source code?

    So what can I do about that? Should I use a different modeling tool or file format?

  • Thomas Ziegenhagen

    You're right: the Collada loader does not use the unit size anywhere. I think it once used to scale the whole scene by it, thus always creating a scene in meters, but I haven't found the scaling code anywhere.

    What do you think about how to handle such "unit of measurement" data? To my knowledge Collada is the only format that contains it, and I usually don't like adding something to the Assimp scene format just for the purpose of a single source file format. Scaling the whole scene to the unit would yield a reliable meter-sized scene in any case and not require enhancing the in-memory format, so I'd prefer this solution.

  • Luca Vezzaro

    Luca Vezzaro - 2011-06-15

    I could scale the whole scene, of course, but I'd prefer to have consistent units while modelling and rendering.

    I just started using assimp, so I don't know what could be the best way to handle this information. Perhaps adding a AI_SCENE_FLAGS_XXX could let the client know that a unit conversion might be needed.
    At the moment I'm just using a hard-coded scale factor, which is not really nice, but I could alway parse myself the first few lines of the collada file to determine what units it's using. So it's not a huge issue.

    Thanks for your answer, though.

  • Glenn W

    Glenn W - 2012-08-21

    Sorry for bumping an old topic, but I'm very interested in a solution to this problem as well. The solution you proposed (uniformly scaling/rotating data to a known configuration) would work fine.

    I'm looking to use assimp in conjuction with OpenSceneGraph and osgEarth, so knowing the rotation/scale is critical.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks