OBJ importer?

Blitz3D Forums/Blitz3D Programming/OBJ importer?

This is a textured cube in .obj file format, which is as you can see, from Gile[s].

If I were you, I would go for Gile[s]. It can import/export .obj with materials and has the capability to bake lightmaps which makes architectural walk-throughs much prettier. Esp. Gile[s] can save to .b3d. This leaves you with writing a viewer for .b3d which is fairly straight forward.
# cobe.obj
# Exported by gile[s]
mtllib cube.mtl
o Scene
#Begin Vertices
v 1.000000 1.000000 -1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
v 1.000000 1.000000 1.000000
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v 1.000000 1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 -1.000000 1.000000
v 1.000000 -1.000000 1.000000
v 1.000000 1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 1.000000 -1.000000
#End Vertices
#Begin Vertex Normals
vn 0.000000 0.000000 -1.000000
vn 0.000000 0.000000 -1.000000
vn 0.000000 0.000000 -1.000000
vn 0.000000 0.000000 -1.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 1.000000
vn 0.000000 0.000000 1.000000
vn 1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn 1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn -1.000000 0.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 -1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
vn 0.000000 1.000000 0.000000
#End Vertex Normals
#Begin Vertex Texture Coords
vt 0.000000 1.000000 0.000000
vt 1.000000 1.000000 0.000000
vt 1.000000 0.000000 0.000000
vt 0.000000 0.000000 0.000000
vt 0.000000 0.000000 0.000000
vt -1.000000 0.000000 0.000000
vt -1.000000 1.000000 0.000000
vt 0.000000 1.000000 0.000000
vt 0.000000 1.000000 0.000000
vt 1.000000 1.000000 0.000000
vt 1.000000 0.000000 0.000000
vt 0.000000 0.000000 0.000000
vt 0.000000 0.000000 0.000000
vt -1.000000 0.000000 0.000000
vt -1.000000 1.000000 0.000000
vt 0.000000 1.000000 0.000000
vt 0.000000 1.000000 0.000000
vt 1.000000 1.000000 0.000000
vt 1.000000 0.000000 0.000000
vt 0.000000 0.000000 0.000000
vt 0.000000 0.000000 0.000000
vt -1.000000 0.000000 0.000000
vt -1.000000 1.000000 0.000000
vt 0.000000 1.000000 0.000000
#End Vertex Texture Coords
#Begin Polygons
g 
usemtl tex
f 1/1/1 3/3/3 2/2/2
f 1/1/1 4/4/4 3/3/3
f 5/5/5 7/7/7 6/6/6
f 5/5/5 8/8/8 7/7/7
f 9/9/9 11/11/11 10/10/10
f 9/9/9 12/12/12 11/11/11
f 13/13/13 15/15/15 14/14/14
f 13/13/13 16/16/16 15/15/15
f 17/17/17 19/19/19 18/18/18
f 17/17/17 20/20/20 19/19/19
f 21/21/21 23/23/23 22/22/22
f 21/21/21 24/24/24 23/23/23
#End Polygons
And the material file:
# cube.mtl
newmtl tex
Ka 1 1 1
Kd 1.000000 1.000000 1.000000
Ks 0.000000 0.000000 0.000000
map_Kd tex.png