Any way to use IMeshBuffer->append(...) ? (1.6.1)

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
klaudia
Posts: 20
Joined: Thu Jun 18, 2009 2:39 pm

Any way to use IMeshBuffer->append(...) ? (1.6.1)

Post by klaudia »

Why this method doesnt work?
i wanna glue one mesh to another, and always
getVertexCount(...) got this same results...

doesnt work this or what?
both meshbuffer are these same types, from file format B3D.

Code: Select all

    if(first->getMeshBufferCount() != 1) return false;
    if(minor->getMeshBufferCount() != 1) return false;

    IMeshBuffer *mbFirst = first->getMeshBuffer(0);
    IMeshBuffer *mbMinor = minor->getMeshBuffer(0);

    if(mbFirst->getVertexType() != mbMinor->getVertexType()) return false;

    printf("%d %d\n",mbFirst->getVertexCount(),mbMinor->getVertexCount());
// --> result 500,100

        mbFirst->append(mbMinor->getVertices(),
                        mbMinor->getVertexCount(),
                        mbMinor->getIndices(),
                        mbMinor->getIndexCount());

    printf("%d %d\n",mbFirst->getVertexCount(),mbMinor->getVertexCount());
// --> result 500,100 still this same

I know append(meshbuffer) is commented inside.

but version with:

append(vertices,vertnum,indices,indnum) its not.

this method is bugged or what?
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Any way to use IMeshBuffer->append(...) ? (1.6.1)

Post by randomMesh »

klaudia wrote:Why this method doesnt work?
Try mbFirst->setDirty() after append().
"Whoops..."
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You cannot append b3d meshes. These are skinned, so the vertex structure inside is completely different. You can, however, use getMesh(0) to get a static mesh and connect those.
Post Reply