slf file format conversion

 From:  Michael Gibson
5410.8 In reply to 5410.1 
Hi Brian,

> If an amateur programmer were to attempt a simple "translation,"
> which 3d format would be easy to convert to, PLY, OBJ, STL...?

Any of those are not too complicated, I would probably recommend OBJ format since it's pretty widespread.

There seems to be a pretty decent explanation here: http://en.wikipedia.org/wiki/Wavefront_.obj_file

And a basic OBJ file can have a pretty simple structure - it's a text file and you'll put in a list of vertices, each vertex will be a line in the text file starting with v followed by x y z coordinates like:

v 0.123 0.234 0.345
v 2.552 5.223 0.251
v 4.223 5.652 2.611


and then to form polygons you make "face" entities after that in the text file. A face can refer to both regular vertices like listed above, and also can refer to texture coordinates and vertex normals. For just basic polygon transfer you can ignore the texture and vertex normals and in that case each face starts with f and then has a list of 1-based (note not zero based) vertex indices. So stuff like

f 1 4 2
f 4 5 1
f 2 5 2

etc...

So all those v lines followed by those f lines will make an OBJ file.

- Michael