PDA

View Full Version : Assimp 3.0 load more models



giogen82
03-18-2014, 09:24 AM
Hello,
I load in my opengl scene (using Assimp 3) two models.

I would, however, first load all models (2 types), and then render them, but when I go to render the scene object importer has already been replaced with the next scene, so I can render only the latest model.

I wrote a class that has Object3d of the static methods to load and render the object.
My model classes, extend Object to use the methods defined in it, and have uun importer object and an object scene.


class Object3D{
public:

static GLboolean Object3D::abortGLInit(const char*);
const aiScene* Object3D::loadData(Assimp::Importer & importer, const std::string& pFile);
static void drawAiScene(const aiScene* sc, Assimp::Importer & importer);
void Object3D::draw();

private:
static void Object3D::Color4f(const aiColor4D *color);
static std::string Object3D::getBasePath(const std::string& path);
static void Object3D::set_float4(float f[4], float a, float b, float c, float d);
static void Object3D::color4_to_float4(const aiColor4D *c, float f[4]);
static void Object3D::apply_material(const aiMaterial *mtl);
static void Object3D::recursive_render (const struct aiScene *sc, const struct aiNode* nd, Assimp::Importer & importer);

};


In loadData method I load file and textures.



class People: public Object3D
{
public:
People();
People(std::string modelpath, GLfloat scaleXInput, GLfloat scaleYInput, GLfloat scaleZInput);
~People();

void init_Object(const std::string& pFile, Assimp::Importer importer);
void People::LoadGLTextures();
void People::draw();
};



Can you explain how to keep the 2 scenes?