Anton's Research Ramblings

29 May 2012

Mesh Loading

It looks like the best way to go is going to be to use a native JSON format file.
Essentially this means that I don't have to write a mesh parser at all, which is nice.
To get to JSON I was originally looking at using a Python script to convert .obj to .json but it looks like there is...
...an exporter for Blender3D called "Machete" which is probably a more elegant solution. Cutting edge?...I had some errors with Machete, but found this .obj to .json Python script. This could go on a server that stores .objs but there's no reason not to batch process the lot off-line.

tl;dl: I have to write a programme to convert .obj meshes into .json files..

New plan:

  1. Demo to load hand-made (or pre-made) JSON mesh file
  2. Write my own programme or script to convert or export to JSON
  3. Profit!

I got a mesh loading from a JSON file:

this is a rotating box-oid that I loaded from a file in JSON format. all points are in one huge array so it plugs right into the gl data operation [x y z x y z x y.. ]etc..


It wasn't difficult to get that working, but there isn't a strict format for a JSON mesh to be in. The exporters and converters were a bit of a let-down, but I already have a C parser of .obj files, so perhaps I can turn this into a little JSON creater in my own layout. Should be the quickest option.