How to get access to individual mesh in a scece graph?

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
fnf
Posts: 2
Joined: Fri Jun 08, 2007 9:11 am

How to get access to individual mesh in a scece graph?

Post by fnf »

Hi.

I'm working on integrating Irrlicht and AGEIA PhysX and stumbled into a problem with trimesh-trimesh collision detection. I intended to manually decompose the trimesh to convex meshes then load each of them as a convex shape into the NxActor.

At the moment I'm using Irrlicht to load the scenegraph (3DS by the way), get the mesh buffer to pass the vertices and indices information to PhysX. The problem is no matter how many individual meshes a scene graph has, they all get cramped into a single mesh buffef: That's just find for rendering, but I want to get access to each convex mesh.

The question is, what do people do when decomposing a mesh?. Do they invent their own 3D format?. Do they split the scene graph into many small files, each one is a convex mesh?. Or was I missing something in the library?.

I'd appreciate any feedback, thanks. Apologies if the questions are not clear enough.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

well.. for drawing it's much faster to draw everything as one buffer, which is why your 3ds exporter will group everything with the same material into one buffer where possible. The 3ds loader may also optimize identical materials into one buffer too.
I suppose this depends on how many different objects you're going to have in your scene, splitting it all up into separate files might not be so expensive if there are not so many separate objects, you could write a script to export your level as many 3ds files with an irr file to describe the scene.

If you have lots and lots of objects (and want to move them) then you might want to look at this batching mesh I made for tile-based games. you add meshes to it, and it merges all the buffers into as few as possible, returning an ID for each buffer. You can change the transformations of the virtual buffers by using their ID, and handle the collision from the original meshes


edit:
two more options for you-
1) change your materials slightly before exporting, so everything isn't optimized into one buffer
2) write a little algorithm to find vertices that are joined by indices, and make your convex hulls from the groups.
I think I like this option best, you could even save the clouds of verts to your own file format instead of searching for them as the meshes are loaded

actually, that sounds like good fun. I think I might write it.. no promises or anything though

...

ok, that was fun :)

http://irrlicht.sourceforge.net/phpBB2/ ... p?p=122479
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply