Register
handmade.network»Forums»Looking for a nudge in the right direction (3D meshes and fileformats)
Pete
22 posts
Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago
Hello everyone!

I have started reading the OpenGL SuperBible and I am playing around a little bit with shader examples etc, I know 3d is a huge subject but right now I am wondering if anyone has any experience with loading models from let's say blender 3d?

What fileformats are easiest to parse for someone who have never parsed a model file at all? Also are there any good, easy to understand resources for this?

// Pete

{;};
Michael Fairley
2 posts

None

Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago
OBJ is fairly simple to parse and is supported by almost all 3d tools.

None
Pete
22 posts
Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago
Thanks! It actually looks easier than I first expected it to be.

It looks pretty verbose though so I guess people usually parse the .obj files and generate more compact versions to use in their apps if they are using .obj files at all?

I am thinking that I would like to convert them myself to have the beginning of the file saying "Hey, ### vertices will follow this header" and then just spam out the raw x, y, z[, w] data.

{;};
Bill Strong
52 posts
Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago
You might try Open Game Exchange Format. Read more about it at http://opengex.org/.

It can handle animation which obj lacks. It is meant to be human readable, and both the spec and source code are released under the Creative Commons 3.0 Share Alike Unported License. It has blender, maya, 3dsmax and an import template available in source code form.
483 posts
Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago
There is also the interquake model format: http://sauerbraten.org/iqm/

Andrew Bromage
186 posts / 1 project

Research engineer, resident maths nerd (Erdős number 3).

Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago
As a non-answer: Do not try to parse COLLADA yourself. In fact, don't use COLLADA unless you have to.

sub f{($f)[email protected]_;print"$f(q{$f});";}f(q{sub f{($f)[email protected]_;print"$f(q{$f});";}f});
Pete
22 posts
Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago
Pseudonym
As a non-answer: Do not try to parse COLLADA yourself. In fact, don't use COLLADA unless you have to.


Why is it that COLLADA is such a bad format? From what I can see it is XML-based which is enough for me to stay away from it but are there other reasons?

{;};
Mārtiņš Možeiko
2127 posts / 1 project
Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago Edited by Mārtiņš Možeiko on July 27, 2016, 10:47 p.m.
There's glTF format from Khronos:
https://github.com/KhronosGroup/glTF
https://github.com/KhronosGroup/glTF/tree/master/specification
https://raw.githubusercontent.com...on/figures/gltfOverview-0.2.0.png

It's not intended as runtime format, but more as transmission / tool-to-tool format. It seems it is more oriented to WebGL (because of json), but for simple stuff or when experimenting you might as well load it at runtime for regular desktop GL/d3d.
Ben Visness
50 posts

HMN admin, Handmade Math contributor, high school robotics mentor/enthusiast, web developer, etc.

Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 2 months ago
Well, if you're looking for something *really* easy to get started, the Stanford PLY format is dead-simple to parse. Not particularly full-featured or practical for real use, but it's easy and Blender can export to it. :)
Pete
22 posts
Looking for a nudge in the right direction (3D meshes and fileformats)
4 years, 1 month ago
Thanks, Wavefront .OBJ and PLY formats looks like the easiest ones to get started with.

{;};