3

Assimp version 5.0.1

I've recently started using assimp to import an fbx file, do some modifications to each vertex of the meshes, then export back out to either fbx/obj.

I've noticed that after exporting the mesh, it is distorted / very faceted. I wondered if I was doing something wrong with exporting the mesh, so removed all unnecessary code and just exported the imported scene using the below:

#include <assimp/Importer.hpp>
#include <assimp/Exporter.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

int main()
{

    Assimp::Importer importer;
    const std::string& pFile = "path/to/file.fbx"
    const aiScene* scene = importer.ReadFile(pFile, aiProcess_EmbedTextures);

    Assimp::Exporter exporter;
    exporter.Export(scene, "fbx", "path/to/export/location/file.fbx", scene->mFlags);
}

The model is correctly geolocated, units are in meters - so it is far from the origin, approx xy offset is (32000, 32000). When moving the geometry from this offset to arouund 0,0 in software such as Autodesk Navisworks, then inputting the modified fbx file with assimp, everything works as expected. So it's not a problem with the geometry, it's to do with the model being far from the origin.

Is there anything I can do to avoid the below from happening without manually moving the model closer to the origin? I've projected each vertex closer to the origin using assimp with the same results as below, so it looks like the model needs to be modified before creating a scene. Is there a way to change the extents of the model prior to import, possibly setting import properties or flags? But keeping the original vertex information? As I need the coordinates of each vertex for processing.

Thanks

The original fbx file: enter image description here

The exported fbx file from assimp: enter image description here

0 Answers0