3DS multiple object mesh manipulation...

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

3DS multiple object mesh manipulation...

Post by goaty »

I have multiple objects ( named ) within a exported 3DS file from my modelling package. I can load the the entire collection of objects to a scene node ( as in all 10 objects are connected together for scale/rotate etc. manipulation ), but how do I attach a separate node to each object that is in the 3DS loaded file? As in I want to separately manipulate each object in the 3DS file. Is this possible or is it better to have each object in a separate file and load them into nodes individually. It's just the latter seems a bit messy?
Any help and or code snippets would be greatly appriciated!
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

All the mesh parts are stored as mesh buffers inside the complete mesh...
You can get access to them by using mesh->getMeshBufferCount() and mesh->getMeshBuffer()...
But the names you gave them are not stored, so you can't use them, you'll have to know which buffer is which part of the mesh...

In my oppinion it's easier to use seperate meshes for each mesh part...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

Thanks for that response. I am currently using separate files, but just seemed a bit clumsy and thought it would be possible for multiple objects accessible from within a single file. Sometimes the mesh count doesn't always come up as what I expect either when I load an exported 3DS file?!?! Is this irrlicht or the modelling package exporter do you think? Or am I not doing something right in my modelling package? They are all separate objects within the scene, but as I say the count doesn't always tally in the software extraction.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

your exporter will probably merge all meshes that share the same material into one buffer. also, even if you split up your mesh into several mesh buffers, add them to empty SMeshes then create nodes, the origin position for each buffer will be lost, so they'll rotate around 0,0,0 position of the original mesh
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

Arrrrrrrrrrrrrrrrrrrrrrrrr! Think you might have hit the nail on the head there with the same-like materials exporting into a single mesh. I do have them all using the same material, hence the difference at software load mesh load. Not too worried about losing the origins so much though, as I can redefine them later. Thanks! :D
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

That worked when I changed all the materials to different ones. I now have access to the mesh buffers. But what do I do with those? How do I get them to being used as a scene node? Or am I being daft? :roll:
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

I take it the nil response means I being daft then. :?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

right, you can't use a mesh buffer for a node (as you want to)...

but you could create a new mesh out of the mesh buffer...
As far as you have access to the mesh buffer datas you can copy the data into a custom scene node (look for tutorial #03)

But it would be easier (and probably faster) to create every mesh part as a single mesh with your 3d editor...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

I see. Thankyou for that response.
Mesh buffer access...Hmmmm just seems clumsy.
Post Reply