Files

2.4 KiB

title, type, source, source_url, author, handle, post_id, date, archived, draft, tags, description, in_reply_to
title type source source_url author handle post_id date archived draft tags description in_reply_to
When writing graphics applications and demos, I've found loading in complex geometry without introducing any ridiculous dependencies (I'm looking at you, Assimp) is a pain and normally results in me writing some crappy special-case parser for OBJ so that I can throw some... archive twitter https://x.com/rfleury/status/1144107248215609344 Ryan Fleury rfleury 1144107248215609344 2019-06-27 2026-08-26 false
archive
twitter
rfleury
When writing graphics applications and demos, I've found loading in complex geometry without introducing any ridiculous dependencies (I'm looking at you, Assimp) is a pain and normally results in me writing some crappy special-case parser for OBJ so that I can throw some...

Source

Thread

1/ @rfleury ^1144107248215609344

When writing graphics applications and demos, I've found loading in complex geometry without introducing any ridiculous dependencies (I'm looking at you, Assimp) is a pain and normally results in me writing some crappy special-case parser for OBJ so that I can throw some... (1/5)

2/ @rfleury ^1144107248911884288

...static geometry into my application easily. This sucks, so I decided to write a single-header OBJ loader in C (also probably close to C++ compatible, but I didn't check). It's not really complete (no material support yet), but does auto-triangulization, sub-models, (2/5)

3/ @rfleury ^1144107249620672512

polygon groups, and works within a fixed-size parsing buffer. The high-level API that it provides (the LoadOBJ function) uses the CRT to load in the file and allocate a huge parsing buffer, but the lower level ParseOBJ function just works on the memory that is passed to it. (3/5)

4/ @rfleury ^1144107250363117569

Documentation, bug fixes, and support will get better as I fix it up a bit, but here's a link to the WIP version for those interested:

https://gist.github.com/ryanfleury/0062f2ffdec07bcda8a4a0ef5c7f8f37

(4/5)

5/ @rfleury ^1144107251134865408

Here's proof that it loads Sponza out of the box (with a lack of proper material support right now)!

(5/5)