appending two meshes

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
grassblade
Posts: 27
Joined: Mon Jan 09, 2006 11:17 am

appending two meshes

Post by grassblade »

Hello,
I am unable to append two meshes with this code. Can somebody point me to the right direction. Even after appending, the vertex count remains the same .The node is shown with the same old mesh even after calling setDirty (EBT_VERTEX_AND_INDEX)..

Code: Select all

         //get object 1 buffer --------------------------------------------- 

	     IAnimatedMesh* mesh = smgr->getMesh("../../media/dwarf.x");  

	     IMesh* dwarfmeshdata=mesh->getMesh(0);

         IMeshBuffer * bufferofmesh= dwarfmeshdata->getMeshBuffer(0);

          //get object 2 buffer  

         IAnimatedMesh* mesh1 = smgr->getMesh("../../media/sydney.md2");

         IMesh* sydneymeshdata=mesh1->getMesh(0);

         IMeshBuffer * bufferofmesh1= sydneymeshdata->getMeshBuffer(0);

         printf("before appending: %i\n", bufferofmesh1->getVertexCount());

         bufferofmesh1->append(bufferofmesh);//appends , but only the original mesh is shown?bug?

         printf("after appending: %i\n", bufferofmesh1->getVertexCount());

         bufferofmesh1->setDirty (EBT_VERTEX_AND_INDEX);

	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh1);
grassblade
Posts: 27
Joined: Mon Jan 09, 2006 11:17 am

Post by grassblade »

:( . Itried searching the forum before i posted this. I couldn't find any solution.I can't get the batching mesh mentioned in a previous post to compile. Isn't there a solution built in in irrlicht?
In the source file of append(), it says it will work only with compatible vertex types. I am not clear on this. I tried using two b3d files and get the same result. Thank you.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

skinned meshes are not apendable, it only works for simple static mesh structures. The append call is not properly implemented so far, it was just meant as a temporary workaround. We're developing more flexible mesh structures currently, but they are not yet very widely used. But you can simply add meshbuffers to the mesh, which does not improve rendering performance, but allows to group geometry in one object.
grassblade
Posts: 27
Joined: Mon Jan 09, 2006 11:17 am

Post by grassblade »

Thanks Hybrid for the reply. I have limited success in appending with

Code: Select all

 meshbufferptr->append(const void *,const u16 *,u32,u32);
The appended buffer is static and the original meshbuffer animates.
Thanks again.
Post Reply