Hi, please can you help with this one?
I have created a scene in Blender - let's say 5 objects (5 cubes). I have exported them to .obj file and loaded to irrlicht. I can see the whole scene - that is no problem.
The problem is that how can I 'work' with objects in the scene? For example I want to move only with one cube from the scene (in scene are 5 cubes).
thank you in advance...
loading and working with .obj file
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
If you are loading one .obj file containing 5 cubes, then you are loading one single mesh and creating one (animated) mesh scene node from it.
If you want to manipulate each cube independently, then you'll have to save out one cube model, load it as a mesh, and create 5 independent mesh scene nodes from it.
If you look in example 01.HelloWorld/main.cpp, then you'll see this code:
To create multiple scene nodes using the same mesh, you'd just have to modify it to:
Of course, in any real app, you'd use (e.g.) an array of IAnimatedMeshSceneNode pointers.
If you want to manipulate each cube independently, then you'll have to save out one cube model, load it as a mesh, and create 5 independent mesh scene nodes from it.
If you look in example 01.HelloWorld/main.cpp, then you'll see this code:
Code: Select all
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );Code: Select all
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
IAnimatedMeshSceneNode* anotherNode = smgr->addAnimatedMeshSceneNode( mesh );
IAnimatedMeshSceneNode* andYetAnotherNode = smgr->addAnimatedMeshSceneNode( mesh );
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
miroslav_karpis
- Posts: 12
- Joined: Tue Jan 13, 2009 7:12 am
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Only if you explicitly create multiple scene nodes in IrrEdit. It doesn't (and can't) know that a single .obj file is meant to contain multiple independent meshes.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way