What libraries of the OpenGL world should I use to compose my program?

I need some help where to start in my case:

I’m developing a scientific application. Basically it will do computational creation of a 2D/3D model, FEM simulation on that model, some geometric analysis on that model. In order to have more flexiblity and less dependency on a myriad of libraries, I plan to create it from rather basic frameworks like OpenGL (for the visualisation and 3D stuff).

I will need the following functionality:

  • Create a window to draw 2D and/or 3D. It would be cool if this window would already provide Zoom/Drag/Rotate and the ability to have multiple sub-plots. An even bigger plus would be the the easy addition of some menus.
  • Plotting of some rather basic objects like polygon meshes, points, lines, text in 2D/3D. Should be extendable to also plot more and more fancy stuff later on.
  • Some mathematical operations for collision/overlap/point-in-polygon tests. I could also use CUDA or something else for that, but I think, OpenGL could also help.
  • Should be able to run on Linux and OS X. Development is on OS X.
  • Should be possible to write Python bindings in order to command the whole program from Python.
  • Easy to access the full functionality of OpenGL and other underlying frameworks in case I need it.
  • A good documentation and easy compilation. I absolutely prefer a well-documented, well-tested basic library that requires me to write a bit more code on myself rather than a magic library that promises to do everything but is poorly documented.

I’m currently reading some introductory material about OpenGL itslef plus I also took a short glance through the OpenGL “ecosystem” but I’m not quite sure out of which libraries/frameworks I should compose my application. Into which resources should I have a closer look?

Your requirements do not look like you actually want to work with low-level openGL. I would recommend a slightly higher level API for that. I dont know what programming language you want to use but if it is java I would recommend either LWJGL which gives you some nice utility functions on top of an actively maintained OpenGL binding or LibGDX which offers a lot of higher level functionality on top of LWJGL.

I agree on that I probably don’t need to go to low-level openGL. Basically I need something to plot primitives in 2D/3D and to Zoom/Rotate/Resize the plots. So some kind of 2D/3D drawing library would be nice. As I said, I prefer “something” that is well-documented, well-portable, well-standardized, well-extendable but requires a bit more work over “something” that does everything for me, but lacks documentation, portability, standarization and extendability.

I plan to use Python, so “something” with Python bindings would be nice, as long as it does not kill performance. Does LWJGL have a Python-bound sister/brother?

For the user interface, I think GLFW will do the job. It seems to have good Python bindings and a nice documentation.

Then there’s one more thing: I will also need to do some non-graphical geometric computations, like point-in-polygon/overlap/distance-from-surface. It would be cool if this could be closely integrated into visualisation and graphics code. First, to utilise the capability of the GPU and second, to be able to draw debug graphics.

LWJGL is just a simple java binding for OpenGL, GLFW, OpenCL, OpenAL and some other utility libraries. But python and java are easy to work together with. There are plenty of bindings for that. Of course, perhaps a direct pythong binding of GLFW could be better. LWJGL itself does not have any support for point-in-polygon/overlap/distance-from-surface tests but LibGDX does since it is a game framework. For using either LWJGL or LibGDX I would recommend having advanced java knowledge though.

You might have a look at OpenSceneGraph (http://www.openscenegraph.org/).

We used this in a previous work and it is possible to use OpenGL directly when needed. They also have some python plugins.