Adding Multiple meshes to a single mesh?

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
roguelike
Posts: 14
Joined: Tue May 30, 2006 11:03 am

Adding Multiple meshes to a single mesh?

Post by roguelike »

How would I add multiple .x meshes to 1 mesh buffer so I can add it to a single SceneNode at runtime?

I have done a search and couldn't find an answer.
________
Medical marijuana card
Last edited by roguelike on Tue Feb 22, 2011 10:49 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Why would you want that to do? Otherwise just copy all mesh buffers to those of the new mesh.
roguelike
Posts: 14
Joined: Tue May 30, 2006 11:03 am

Post by roguelike »

I was thinking of creating a random maze made up of boxes, instead of adding one box per sceneNode or even TestSceneNodes, creating the whole mesh in one go, then having only 1 sceneNode.

It's purely for performance.
________
JAILBROKEN
Last edited by roguelike on Tue Feb 22, 2011 10:49 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

But you will get a much better performance when doing the triangulation on your own, i.e. not just joining all boxs into one buffer, but also merging adjacent faces.
roguelike
Posts: 14
Joined: Tue May 30, 2006 11:03 am

Post by roguelike »

Thanks for the speedy response.

I can see how you can getVertices() and getIndices() from a mesh buffer, but how do you set them?

Are there any functions, routines that you know of that will achieve something similar?

Maybe I need to go away and have a play, then come back again?
________
HERBALAIRE
Last edited by roguelike on Tue Feb 22, 2011 10:49 pm, edited 1 time in total.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

SMeshBuffer is (just as the 'S' says) a struct, so all data is accessible. Even the Indices and Vertices. Simply use push_back on Vertices and Indices.
roguelike
Posts: 14
Joined: Tue May 30, 2006 11:03 am

Post by roguelike »

Thank you for your help, I will try some things out based on your information.
________
H Engine
Post Reply