4 ms·
That sounds like a fun challenge. If you're constraining yourself to use as few libraries as possible, I'd go with OBJ [1] for the 3d mesh and PPM [2] for writi
by pfranz 5y ago
That sounds like a fun challenge. If you're constraining yourself to use as few libraries as possible, I'd go with OBJ [1] for the 3d mesh and PPM [2] for writing images. It's easy to implement a bare bones reader/writer and some OSes (like macOS) can show them in the file browser. Raytracing in One Weekend goes over PPM. There are a bunch of header-only libraries that handle different file formats like stb_image [3]. I usually end up using those when I start dealing with textures or UI elements. I don't use Windows so I haven't used their APIs for projects like this. I'd usually go for imgui or SDL (like you mentioned). tinyracaster, a sibling project of tinyrenderer, touches on those [4]. I liked LazyFoo's SDL tutorial [5]. Good luck!
[1] https://en.wikipedia.org/wiki/Wavefront_.obj_file https://en.wikipedia.org/wiki/Wavefront_.obj_file
[2] https://en.wikipedia.org/wiki/Netpbm#PPM_example https://en.wikipedia.org/wiki/Netpbm#PPM_example
[3] https://github.com/nothings/stb https://github.com/nothings/stb
[4] https://github.com/ssloy/tinyraycaster/wiki/Part-4:-SDL https://github.com/ssloy/tinyraycaster/wiki/Part-4:-SDL
[5] https://lazyfoo.net/tutorials/SDL/index.php https://lazyfoo.net/tutorials/SDL/index.php
- i45_n5 5y agoYeah, I know about ppm but I didn't know about .obj files. That's great. And sdl is a good crossplatform choice because linux doesn't have similar to win api GDI. Thanks for the links.