Handwritten X, .3DS or .B3D file

Miscellaneous Forums/General Discussion/Handwritten X, .3DS or .B3D file

I have no Idea how the internals of X, .3DS or .B3D (or any 3d format) are sorted. I normaly just use a 3d package.

However I have a pressing need to know how at least one of them can be written internaly. That is, imagine I have a big long list of defDatas that I want to put into a 3d format.

Ive done a search on the net, and all I could find was some microsoft rubbish about .x which didnt help.

Can someone
1) Tell me what 3d file system is best for buildings/levels, [that is, it doesnt need bones, but lights, textures and stuff would be good]
2) How to hand write it. or a good page that tells me how to do that

Thanks in advance.

(PS I am assuming that once I have hand written the file, I can just use Milkshape or the like to convert it to the other formats)

Easiest way would probably be Collada, since that uses some kind of XML markup, which should be pretty easy to handwrite compared to the other formats. Not sure if Milkshape can import Collada or not, but if it can. that might be an option.

https://collada.org/public_forum/welcome.php

I found the .x text format relatively easy:
xof 0302txt 0064

Header {
 1;
 0;
 1;
}

Frame frm_Scene_Root {
 FrameTransformMatrix {
 1.000000,0.000000,0.000000,0.000000,
 0.000000,1.000000,0.000000,0.000000,
 0.000000,0.000000,1.000000,0.000000,
 0.000000,0.000000,0.000000,1.000000;
}

Frame frm_Unknown {
 FrameTransformMatrix {
 1.000000,0.000000,0.000000,0.000000,
 0.000000,1.000000,0.000000,0.000000,
 0.000000,0.000000,1.000000,0.000000,
 0.000000,0.000000,0.000000,1.000000;
}

 Mesh frm_Unknown {
//vertices
24;
-1.0;1.0;-1.0;,
1.0;1.0;-1.0;,
1.0;-1.0;-1.0;,
-1.0;-1.0;-1.0;,
1.0;1.0;-1.0;,
1.0;1.0;1.0;,
1.0;-1.0;1.0;,
1.0;-1.0;-1.0;,
1.0;1.0;1.0;,
-1.0;1.0;1.0;,
-1.0;-1.0;1.0;,
1.0;-1.0;1.0;,
-1.0;1.0;1.0;,
-1.0;1.0;-1.0;,
-1.0;-1.0;-1.0;,
-1.0;-1.0;1.0;,
-1.0;1.0;1.0;,
1.0;1.0;1.0;,
1.0;1.0;-1.0;,
-1.0;1.0;-1.0;,
-1.0;-1.0;-1.0;,
1.0;-1.0;-1.0;,
1.0;-1.0;1.0;,
-1.0;-1.0;1.0;,

//triangles
 12;
 3;0,1,2;,
 3;0,2,3;,
 3;4,5,6;,
 3;4,6,7;,
 3;8,9,10;,
 3;8,10,11;,
 3;12,13,14;,
 3;12,14,15;,
 3;16,17,18;,
 3;16,18,19;,
 3;20,21,22;,
 3;20,22,23;;

MeshMaterialList {
1;
1;
0;;

Material {
//color, texture
 1.000000,1.000000,1.000000,1.000000;;
 1.000000;
 0.500000,0.500000,0.500000;;
 0.000000,0.000000,0.000000;;
      TextureFilename {
        "kubus.bmp"; }
}
}

//normals
MeshNormals {
24;
0.0;0.0;-1.0;,
0.0;0.0;-1.0;,
0.0;0.0;-1.0;,
0.0;0.0;-1.0;,
1.0;0.0;0.0;,
1.0;0.0;0.0;,
1.0;0.0;0.0;,
1.0;0.0;0.0;,
0.0;0.0;1.0;,
0.0;0.0;1.0;,
0.0;0.0;1.0;,
0.0;0.0;1.0;,
-1.0;0.0;0.0;,
-1.0;0.0;0.0;,
-1.0;0.0;0.0;,
-1.0;0.0;0.0;,
0.0;1.0;0.0;,
0.0;1.0;0.0;,
0.0;1.0;0.0;,
0.0;1.0;0.0;,
0.0;-1.0;0.0;,
0.0;-1.0;0.0;,
0.0;-1.0;0.0;,
0.0;-1.0;0.0;,
//triangles for normals (same as other triangles)
 12;
 3;0,1,2;,
 3;0,2,3;,
 3;4,5,6;,
 3;4,6,7;,
 3;8,9,10;,
 3;8,10,11;,
 3;12,13,14;,
 3;12,14,15;,
 3;16,17,18;,
 3;16,18,19;,
 3;20,21,22;,
 3;20,22,23;;
}

//uv coordinates
MeshTextureCoords {
24;
0.666667;0.5;,
1.0;0.5;,
1.0;1.0;,
0.666667;1.0;,
0.0;0.0;,
0.333333;0.0;,
0.333333;0.5;,
0.0;0.5;,
0.666667;0.0;,
1.0;0.0;,
1.0;0.5;,
0.666667;0.5;,
0.0;0.5;,
0.333333;0.5;,
0.333333;1.0;,
0.0;1.0;,
0.333333;0.0;,
0.666667;0.0;,
0.666667;0.5;,
0.333333;0.5;,
0.333333;0.5;,
0.666667;0.5;,
0.666667;1.0;,
0.333333;1.0;;
  }
 }
 }
}

And I've never tried it, but VRML ?

Use .B3D, here's how to do it:

http://www.blitzbasic.com/sdkspecs/sdkspecs/b3dfile_specs.txt

http://www.blitzbasic.com/sdkspecs/sdkspecs/b3dfile_utils.zip

http://www.blitzbasic.com/sdkspecs/sdkspecs.php

Thats odd.

Thanks Mustang, that is exactly the sort of thing I wanted. But weird like, that I come here most days, and Ive never seen the specs page.

I recon it didnt exist until you posted the link to it.