How to create IMesh from MeshBuffer?

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
moriwo
Posts: 40
Joined: Fri Jul 04, 2008 9:29 pm

How to create IMesh from MeshBuffer?

Post by moriwo »

How to create IMesh from MeshBuffer?


I want to get 2 or more MeshBuffers from 1 .xfile.

I want to use one MeshBuffer for the collision.
and, another one MeshBuffer for draw.

but , AddOctTreeSceneNode needs IMesh.

so, I want to create IMesh from MeshBuffer.

what should i do?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

moriwo wrote:How to create IMesh from MeshBuffer?
Uh...

Code: Select all

scene::SMesh* mesh = new SMesh;
mesh->addMeshBuffer (meshBuffer);
meshBuffer->drop ();

// now you have a mesh...
moriwo wrote:I want to get 2 or more MeshBuffers from 1 .xfile.
You should be able to disassemble the animated mesh pretty easily. Once you've done that you just need to figure out which mesh buffers represent the collision data, and which represent the visuals. It might actually be simpler to save the collision mesh as a seperate file which you can load independently from the original mesh.

Travis
moriwo
Posts: 40
Joined: Fri Jul 04, 2008 9:29 pm

Post by moriwo »

thanks vitek.

The problem is solved by your help.
elektrikal
Posts: 17
Joined: Tue Sep 26, 2006 8:01 am

You should be able to disassemble the animated mesh...

Post by elektrikal »

hello.
this sentence caught my attention:

"You should be able to disassemble the animated mesh pretty easily."

can u plz post some example code on how can this be achieved?

many thx in advance.
Sorry about my bad english.thanks.
Post Reply