Hello one and all,
My goal is to export triangle geometry *from* irrlicht into an ASCII file -- AutoCAD .DXF.
I'm starting with a cylinder primitive at (0, 0, 0), which I scale, rotate, and translate into place to fit my needs. I've imported an OBJ file (a cylinder primitive) into irr::scene::IMesh and transformed the mesh by setScale, setPosition, and parented the node via setParent.
My question is: how is it possible to get a list of the transformed poly vertices and indices for the transformed parent node, so I can store the list in a file?
The format I want to export to (.DXF) uses a similar mesh representation to Irrlicht: vertices in a list, and then poly face definitions that reference those vertex indices to create geometry. I haven't had to access vertices or indices for a mesh before, however, and don't know how to get a list of vertices/indices connected to a given node.
If anyone is aware of other threads about geometry export from Irrlicht, or can suggest a starting point, I'd be extremely grateful.
Exporting transformed mesh polys (as DXF)
I guess you grab the absolute transformation of the node and then multiply each vertex by that to get their resulting position to be output...
You get the mesh by doing node->getMesh() (if you've got an IMeshSceneNode pointer) and then you can get the meshbuffers from the IMesh.
The poly list would be the indices from the meshbuffers.
You get the mesh by doing node->getMesh() (if you've got an IMeshSceneNode pointer) and then you can get the meshbuffers from the IMesh.
The poly list would be the indices from the meshbuffers.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
In order to integrate this export module properly with Irrlicht you should write an IMeshWriter interface for DXF. Then, you get the absolute transformation matrix and pass that, together with the mesh, to the meshmanipulator method getTransformedMesh. The transformed mesh is passed to the mesh writer.