ryu577/pyray

Configurable output types

jordaneremieff opened this issue · 3 comments

First off, I just want to say this project is really cool, and it's great to see a pure Python 3d rendering library like this. Great work! :)

I've started experimenting with it in the browser using ASGI and websockets, https://github.com/erm/starray. This example modifies the draw_oscillating_sphere method slightly to write the output to a bytes buffer and stream it to the browser, rather than writing a series of image files to the disk.

Would this project be open to configurable output settings or some other solution to bypass saving images for cases like this?

Thanks erm 👍
Also, this is the first instance of the code being used outside the main repo I'm aware of - Awesome to see it being used in other great projects!

It would definitely be great to have the option to use the images in other formats. I'll take a deeper look at your code and see how to add that option. If it's an easy change, feel free to send a PR as well and I can build it and push to pypi.

Sounds good! I think the change should be relatively straight-forward, so I'll try putting together a PR sometime this week.

Just a quick update:

I still intend to put forward a PR for this change, but the implementation may actually be less trivial than I originally anticipated in terms of how it could accommodate more than just my use-case. I hope to find the time to do this soon-ish.