Import 3d Model from C4D to my scene... with right position

Hi!
I’m trying to do my “import model manager” using “ofxAssimpModelLoader” because it’s really useful and i can also import animation.
I’m trying to understand why i can’t position the model in the same position of my Cinema4D projects.
For example
in C4D i created a cube of 10 meters and i move in this coords: 55, 0, 0 and i exported in scale 1cm.
When i import using “ofxAssimpModelLoader”, i can see that min and max coords of my mesh are right (5000 and 6000 centimeters for the x) but later
vertex are probably normalized and if i print my vertex
x min is -5 and x max is 5. Ok
it has sense
but i don’t need.
My problem is that i can’t access to the real coordis of my model. If i try to get scene center, i see 55. Yes
now it’'s the same value of my real x position, but not in every case. For example, if i use a non-simmetric shape
scene center became the medium coord from min and max.
So
. my solution is to find where coords are normalized
but till now i don’t find nothing and i don’t know if is right way. Other way could be some proportion
but i tried with some ofMap proportion but with not good results. :slight_smile:
I also tried to export some model inside a “null” object in C4D to try to change the pivot point, but doesn’t work.
So… anyone of you have already done this stuff and found the solution?

If you want to see how i make the model, you can download here:

www.mauroferrario.com/file/cube10metersX50meters.dae
www.mauroferrario.com/file/cube10metersX50metersLongSide.dae

And this is the really simple code:

  
  
#include "ModelManager.h"  
  
ModelManager::ModelManager()  
{  
    this->setup();  
}  
  
void ModelManager::setup()  
{  
    showNewInfoModels = false;  
}  
  
void ModelManager::update()  
{  
}  
  
void ModelManager::loadModel(string url)  
{  
    cout << "*** LOAD MODEL: " << url << " ***" << endl;  
    models.push_back(new ofxAssimpModelLoader());  
    models[models.size() - 1]->loadModel(url, true);  
    models[models.size() - 1]->setScaleNomalization(false);  
    showNewInfoModels = true;  
}  
  
void ModelManager::draw()  
{  
    ofVec3f position;  
      
    if(showNewInfoModels)  
       cout << "*************** NEW MODELS INFO ***************" << endl;  
          
    for(int a = 0; a < models.size(); a++)  
    {  
        ofVec3f scale = models[a]->getScale();  
        ofVec3f position = models[a]->getPosition();  
        ofVec3f sceneCenter = models[models.size() - 1]->getSceneCenter() / 100;  
        float normalizedScale = models[a]->getNormalizedScale();  
        ofVboMesh mesh = models[a]->getMesh(0);  
        ofTexture texture = models[a]->getTextureForMesh(0);  
        ofMaterial material = models[a]->getMaterialForMesh(0);  
          
        if(showNewInfoModels)  
            cout << "***************     VERTEX     ***************" << endl;  
          
        vector<ofVec3f>& verts = mesh.getVertices();  
        for(int i = 0; i < verts.size(); i++){  
              
            verts[i].x /= 100;  
            verts[i].y /= 100;  
            verts[i].z /= 100;  
              
            if(showNewInfoModels)  
                cout  << verts[i] << endl;  
        }  
          
        if(showNewInfoModels)  
            cout << "***************   END VERTEX   ***************" << endl;  
          
        sceneCenter.y *= -1;  
        ofPushMatrix();  
          
          
        texture.bind();  
        material.begin();  
        mesh.drawWireframe();  
        material.end();  
        texture.unbind();  
          
        ofPopMatrix();  
              
        if(showNewInfoModels)  
        {  
            cout << "***************       INFO     ***************" << endl;  
            cout << "Model ID " << a << endl;  
            cout << "Scene Center " << models[a]->getSceneCenter()/100 << endl;  
            cout << "Scene Max " << models[a]->getSceneMax()/100 << endl;  
            cout << "Scene Min " << models[a]->getSceneMin()/100 << endl;  
            cout << "Normalized Scale = " << normalizedScale << endl;   
            cout << "Model Scale = " << scale << endl;   
            cout << "Position = " << position << endl;  
        }  
      
    }  
    if(showNewInfoModels)  
        showNewInfoModels = false;  
}  
  
void ModelManager::clearAllModels()  
{  
    models.clear();  
}  
  
  

Hi Mauro,

im new to this forum and nearly new to oF, but may i see the header file then i may try this one!