Coin3d using FLTK for display

15 views
Skip to first unread message

Paul Hahn

unread,
Dec 8, 2025, 7:41:16 AM (8 days ago) Dec 8
to fltk.general
If anyone is familiar with Coin3d, it has libraries for display using various GUI toolkits, including Qt, ('quarter') and wxWindowns ('SoWx'), etc.

Does anyone know about an attempt to add the FLTK binding to Coin3d?

ChatGPT reports "no", but humans know more!

I understand of course that such it would be based on using Fl_Gl_Window.

Thanks,


Ian MacArthur

unread,
Dec 8, 2025, 9:15:38 AM (8 days ago) Dec 8
to fltk.general
On Monday, 8 December 2025 at 12:41:16 UTC Paul wrote:
If anyone is familiar with Coin3d, it has libraries for display using various GUI toolkits, including Qt, ('quarter') and wxWindowns ('SoWx'), etc.

Does anyone know about an attempt to add the FLTK binding to Coin3d?

ChatGPT reports "no", but humans know more!

This human doesn't know any better than ChatGPT.
At least as far as this goes...
 
I understand of course that such it would be based on using Fl_Gl_Window.

Never having actually tried, I imagine it might be possible to embed a Coin3D scene into an FL_GL_Window "as-is" so maybe that's enough?
But I guess what you are asking is whether there's a way to draw FLTK widgets from "within" a Coin3D scene? In which case, I don't know.
That said, if you look at the "cube" demo, it does (kind of) draw FLTK widgets within, and trigger FLTK widgets from, the GL window, so... might be possible?
 

Matthias Melcher

unread,
Dec 9, 2025, 5:36:10 AM (8 days ago) Dec 9
to fltk.general
Coin3D uses one or more OpenGL context to render its graphics and events from the underlying library. Everything else seems to be independent of the underlying GUI library. FLTK does provide an OpenGL1 or 3 context, so, yes, they can be linked. There is an example program in the source code, based on GLUT, that can be adapted to work with FLTK. 

I don't know of any existing code to link Coin3D and FLTK, but it should be possible without too much effort. If you do implement the bindings, it would be great if you could send us a link to the code, so we can refer to that in the future.

Basile Starynkevitch

unread,
Dec 9, 2025, 5:40:15 AM (7 days ago) Dec 9
to fltkg...@googlegroups.com
On Mon, 2025-12-08 at 04:41 -0800, Paul Hahn wrote:
> If anyone is familiar with Coin3d, it has libraries for display using various GUI toolkits, including Qt, ('quarter') and wxWindowns ('SoWx'), etc.
>
> Does anyone know about an attempt to add the FLTK binding to Coin3d?


FLTK is already a good GUI toolkit, and in my experience mixing two different GUI toolkit libraries is painful and risky
-since most toolkits have some internal state-

Another approach would be to have two communicating processes: one for the user interface, and the other for the background computations.

(The user interface could even be GNU emacs - which do not use today -december 2025- the FLTK toolkit; but it is every easy to script)

Regards from near Paris in France

--

Basile STARYNKEVITCH basile AT starynkevitch DOT net
8 rue de la Faïencerie http://starynkevitch.net/Basile/
92340 Bourg-la-Reine https://github.com/bstarynk
France https://github.com/RefPerSys/RefPerSys
https://orcid.org/0000-0003-0908-5250

Matthias Melcher

unread,
Dec 9, 2025, 1:52:30 PM (7 days ago) Dec 9
to fltk.general
Coin3d is not a GUI toolkit. It's an OpenSource implementation of Inventor. It renders scene graphs containing cameras, lights, and geometries into an OpenGL window. It has a few element that can be used by the GUI - for example, you can send a ray starting at the mouse click position to find the the first object that the ray hits - but it doesn't implement GUI elements itself.


So looking at the source code for binding to glx, binding to FLTK is really easy: you create an SoSceneManager and call setRenderCallback to set the callback that Coin wants to call when the scene changes. In FLTK, this calls the corresponding Fl_GL_Window::redraw(). The in Fl_GL_Window::draw(), you call scenemanager->render(); .

That's already it to get a 3d scene rendered.

Paul Hahn

unread,
Dec 10, 2025, 4:59:46 AM (7 days ago) Dec 10
to fltk.general
Great, thank you for the pointers. I will try to do it myself then. Best regards to all who are so helpful on this forum!
Reply all
Reply to author
Forward
0 new messages