danini-the-panini / mittsu

3D Graphics Library for Ruby.
https://github.com/danini-the-panini/mittsu
MIT License
506 stars 33 forks source link

Using mittsu without graphics #115

Open Floppy opened 1 year ago

Floppy commented 1 year ago

For my use case, I want to manipulate some 3d object files in Ruby, but I don't need to render them; instead I'm using THREE.js in the browser for that. So, in the interests of minimising dependencies would it be possible to make the library work without pulling in OpenGL unless a rendering context is created? I tried to use it without glfw3 installed just to see if it would cope, but it wouldn't start up.

This could perhaps either be done by adapting the code in the library as-is, or for a more extreme solution, splitting the non-graphical stuff out into a separate gem, something like mittsu-core. Do you think either are possible? I'm happy to try this, but it would be good to know what approach you'd prefer I investigate before I do so!

danini-the-panini commented 1 year ago

I've definitely thought about splitting the code out. It was adapted from THREE.js directly, which supports swapping out renderers. The idea would be to have mittsu-core and separate renderers, e.g. mittsu-renderer-[name] e.g. mittsu-renderer-opengl and mittsu-renderer-direct3d etc.

Floppy commented 1 year ago

I was going to suggest exactly that renderer split too, but thought I'd keep it simple to start with :)