Search code examples
linuxopengl3dopen-source

OpenGL 3D Mesh Extraction for Linux


For Windows there are many tools for extracting 3D data from programmes by intercepting the OpenGL data (e.g. 3D Ripper DX, glintercept, Ogle, OpenGLXtractor, HijackGL).

Are there any similar tools for Linux? If not, would it be possible to make one? (and if would anyone be interested in starting an open source project with me?)

I will actually automate the process, but that is another story.


Solution

  • First a word of warning: OpenGL is not a scene graph. There is no such thing as a "scene" or "objects" (in the physical kind of thing sense) in OpenGL. All what OpenGL does is drawing points, lines and triangles to a scene, one at a time and independent from each other. So intercepting OpenGL drawing calls to extract objects by nature is unreliable. That being said most programs using OpenGL do it in a way that make it actually quite feasible to extract the rendered geometry and interpret it as objects.

    Another member of my hackerspace wrote a tool for intercepting OpenGL calls to extract meshes (the original use was so that we could 3D print game assets and similar on our RepRap). The sources for this tool can be found here https://github.com/mazzoo/ogldump

    However ogldump is very limited. It doesn't support vertex buffer objects (VBO), interleaved vertex arrays can mess things up and things like shaders and generic vertex attributes are completely unheared of. Feel free to patch that in, if you like.