SP4CEBAR 2023-01-10 17:23
I passed through the gate of math
SP4CEBAR 2023-01-10 17:25
Apparently, OBJ files are pretty simple, maybe I can make a viewer for those, then I can use external software to define shapes
Jeanmilost 2023-01-10 21:46
Are you speaking about the WaveFront objects (.obj)? If yes, indeed they are very simple, as it’s just a vertices and indices list, if you ignore the UV textures, the groups, special shapes like Besier curves, and material related file (.mat). But normally very simple objects should contain only basic coordinates (vertices, indices, UV coords) and you can ignore the other data. I wrote a very basic C parser in the past, I may give you the link (Github) if you’re interested.
SP4CEBAR 2023-01-11 11:13
Thanks for explaining!
I'm interested
Jeanmilost 2023-01-11 22:34
Here is the link:
https://github.com/Jeanmilost/CompactStar/
The WaveFront parser is located in SDK/CSR_WaveFront.c and SDK/CSR_WaveFront.h files.
This project is a small 3d engine I wrote and use sometimes to create quick prototypes on my iPhone. The above link is the PC and MacOS version, but it may also be compiled on iOS, by using a small embedded c compiler for iPhone, named Mobile C Compiler. If you’re interested, I also released a special version adapted for this compiler:
https://github.com/dztall/ucc/tree/master/3D%20engine/CompactStar%20Engine
Finally here are some of the documentation I used to write my parser:
http://paulbourke.net/dataformats/obj/
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-7-model-loading/
Hope this will help 🙂
SP4CEBAR 2023-01-12 09:58
wow, thank you!
Jeanmilost 2023-01-12 21:57
You’re welcome 🙂
SP4CEBAR 2023-01-25 11:12
Update: Rotation works
412lop 2023-02-04 00:11
Why does the cube get squished
SP4CEBAR 2023-02-04 10:51
you mean stretched along the Z-axis?
that's probably because of my matrices, there may be a flaw somewhewe