Moving different goups of 3ds model

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
matrixx
Posts: 8
Joined: Thu Nov 01, 2007 1:50 pm

Moving different goups of 3ds model

Post by matrixx »

I'm I beginner with Irrlicht and need help with my mesh. I have dummy excavator extracted in 3ds-format. It has different groups for the pit, "wheels", and the different parts of the shank and bucket. I have got it to show up in Irrlicht right with the textures, but now I have to move the different parts of the model separately. I know how to move the whole model, but how can I access to different groups to move them separately?
(I'm really new with Irrlicht and a girl, so please be nice to me ;)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Not a particularly easy job i'm afraid!

If the seperate parts are in seperate groups in the 3ds file then you may be able to get access to them through the mesh buffers (not sure if they'll be in individual mesh buffers or not...).

And then i'm not sure if you'll be able to apply different transformations to the groups...

Can you do joints in 3ds? If you could then you can get a 'pointer' to the specific joints (wheel axles for a start perhaps) and then rotate them as necessary. So you could certainly do that in .ms3d (milkshape format) and i think .b3d but possibly not in .3ds.
Image Image Image
matrixx
Posts: 8
Joined: Thu Nov 01, 2007 1:50 pm

Post by matrixx »

Thanks, I try to get access to the parts through meshbuffers first, and then try that more radical thing you mentioned :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

But note that the 3ds loader does not care for 3ds groups, so you have to apply different materials to those groups in order to get different mesh buffers.
matrixx
Posts: 8
Joined: Thu Nov 01, 2007 1:50 pm

Post by matrixx »

mmm, there are 39 different materials on the mesh. I loaded my mesh as IAnimatedMesh, and I don't know how to access meshbuffer through that. Though I could access meshbuffers if the mesh would have been Imesh, but I can't see how can I load the mesh to ImeshSceneNode, because:
Scenemanager->getMesh doesn't work with Imesh, so I don't know how to load it :(
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

smgr->getMesh() returns an animated mesh i think, then on the animated mesh you use getMesh(0) to get the first frame of the animation. If the model isn't animated then this is just the standard model's frame.
Image Image Image
matrixx
Posts: 8
Joined: Thu Nov 01, 2007 1:50 pm

Post by matrixx »

I think I have two options:
1) To use IanimatedMesh, but I don't know how to access it's meshbuffers
2) To use Imesh, where I know how to access meshbuffers, but I don't know how to load the mesh.
Is there easy way to do either?
I'm using nonanimated mesh, so it's same to me which type I use.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

IAnimatedMesh* aniMesh = smgr->getMesh(path);
IMesh* mesh = aniMesh->getMesh(0);
ISceneNode* node = smgr->addMeshSceneNode(mesh);

see?

It's all in the tutorials anyway so you should know this!
Image Image Image
matrixx
Posts: 8
Joined: Thu Nov 01, 2007 1:50 pm

Post by matrixx »

Sorry beeing so stupid :) Thanks so much, I have to continue working on monday, now have to go to weekend holidays, but I think that may help me much, if only the meshbuffers have shared the group information right because there is much more materials than groups in the mesh :/
matrixx
Posts: 8
Joined: Thu Nov 01, 2007 1:50 pm

Post by matrixx »

Hi again! (Sorry for double posting)
I've decided to abandon this way of approching the project, so I have a new one:
This excavator is in .max project. It contains the graphical version and a collision model consisting some simple primitives, that includes joints, which were hiding in a second layer, so I didn't notice them first. Now my question is, in which format I can export the model from .max so I don't lose the collision model and joint information, or is it possible at all. My goal is to import the model to Newton, ODE or other fysics engine and draw it with Irrlicht. Now I realized my question should have been in external tools section, but since I started the topic already, I hope I can have answers here :)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Just have the collision model as seperate model, so you will have two models exported to then import into irrlicht; the model for rendering e.g. rendermodel.3ds and the model to give to the physics engine for collision e.g. physicsmodel.3ds.
Image Image Image
matrixx
Posts: 8
Joined: Thu Nov 01, 2007 1:50 pm

Post by matrixx »

Thanks JP I can always count on you :)
how do I "attach" the renderingmodel to physicsmodel so Irrlicht know how to draw rendering model in the same position that the physicsmodel is?
Post Reply