Irrlicht and OpenMesh?

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
ph03
Posts: 3
Joined: Tue Sep 25, 2007 4:38 pm

Irrlicht and OpenMesh?

Post by ph03 »

Hi!
I´m planning to use the Irrlicht Engine in an university project because i like it´s architecture. The only thing that I'm missing is an elaborate triangle-mesh data-structure (correct me if it has one however, I would be happy about that!).
I need an data-structure that is similar to, for example, the half-edge structure of the OpenMesh project http://www.openmesh.org where I´m able to find the adjacent triangles of a given triangle or vertex.
Now I wanted to ask if it is possible to include the openmesh data-structure into the Irrlicht Engine by, for example, implementing a new class of the irr::scene::IMesh interface.
I haven´t used Irrlicht yet and don´t know, if something related is easily possible but I would be happy for any suggestions.
Regards, ph03
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

From a first glance I'd say that it's easiest to use OpenMesh as the algorithmic data structure and convert them to Irrlicht structures in a simple linear conversion. You'd probably have to convert it each frame, or at least every time you did some conversion.
If you'd like to add OpenMesh more tightly you might go for a new MeshBuffer implementation. But mesh buffers don't reder themselves so you'd have to add new render methods (or at least new case statements).
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Sight unseen, I'd say: suck it and see. Irrlicht is a dream to modify compared to the other rendering engines that I've tried.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
ph03
Posts: 3
Joined: Tue Sep 25, 2007 4:38 pm

Post by ph03 »

hybrid wrote:From a first glance I'd say that it's easiest to use OpenMesh as the algorithmic data structure and convert them to Irrlicht structures in a simple linear conversion. You'd probably have to convert it each frame, or at least every time you did some conversion.
If you'd like to add OpenMesh more tightly you might go for a new MeshBuffer implementation. But mesh buffers don't reder themselves so you'd have to add new render methods (or at least new case statements).
Thanks for the suggestion. Implementation of a new MeshBuffer or the use of a Costum-SceneNode to display the geometry, I think that would work somehow. But another think I need a User to be able to is to "mark" / select a specific face or even vertex by clicking into the mesh. There is the CollsionManager class offering Ray-Casting to get the intersecting triangle of the geometry, but how do I relate this found triangle back to my OpenMesh mesh? Is it possible to find any ID or index belonging to the found triangle?
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Not with the existing methods. I'd suggest adding a new output parameter to ISceneCollisionManager::getCollisionPoint() to return the index of the hit triangle, as well as its vertices. That's on my to-do list, after I get some other collision changes committed.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
ph03
Posts: 3
Joined: Tue Sep 25, 2007 4:38 pm

Post by ph03 »

Any news about this topic yet? I would still like to use irrlicht together with an efficient triangle mesh data structure like openmesh or the CGAL polyhedron class ( http://www.cgal.org/Manual/3.3/doc_html ... _main.html ).
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Sorry, no. Collision is low down the priority list for the SVN devs, and there's a limit to how many patches I can stand to see rotting in the tracker.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Icare
Posts: 14
Joined: Tue Jun 24, 2008 3:44 am

Post by Icare »

I'm also trying to link OpenMesh and Irrlicht.
The problem is that OpenMesh and Irrlicht can only read / write mesh from a file and never from a buffer (maybe i am wrong).

So maybe i need to write my own Irrlicht class to load mesh, not from a file, but from a buffer.

There is any other solution in C++ ? (for example redirect file writing into a char buffer ?)

Thanks,
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You can load a mesh from any IReadFile handle in the latest SVN versions, which would allow to use a memory read file (which means, to make a sea of bytes a virtual file).
Post Reply