load 3d model

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
aiman
Posts: 19
Joined: Thu Nov 06, 2014 5:04 pm

load 3d model

Post by aiman »

i am using collada with irrlicht, i load a collada model using this

Code: Select all

 
scene::IAnimatedMesh* model;
smgr->getParameters()->setAttribute(irr::scene::COLLADA_CREATE_SCENE_INSTANCES, true);
model = smgr->getMesh("mesh.dae");
 
it works well
but I want to replace this model with another, i have to delete old model, then load a new model
I use this code

Code: Select all

smgr->getMeshCache()->removeMesh(model)
but not work,the old model still appear
help me
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: load 3d model

Post by mongoose7 »

You need to load the new model:

Code: Select all

model = smgr->getMesh("newmesh.dae");
From the names alone, I would say that

Code: Select all

smgr->getMeshCache()->removeMesh(model)
merely removes the mesh from the mesh cache.
CuteAlien
Admin
Posts: 9929
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: load 3d model

Post by CuteAlien »

To appear you have to create scenenode somewhere. Which you probably do. And to remove it you have to remove that node. Check this link that gives a quick overview for the basic Irrlicht structures: http://irrlicht3d.org/wiki/index.php?n= ... ommonTerms
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply