Archived

This topic is now archived and is closed to further replies.

MS3D ASCII format

This topic is 6212 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I downloaded the SDK 1.2 and there is a directory named spec
in it you can find :
MilkShape 3D ASCII.txt
ms3dspec.txt.c


here is MilkShape 3D ASCII.txt for your convenience :

// MilkShape 3D ASCII File Format Specification: 1 box, 1 material, a simple animation

// total frames
Frames: 30

// current frame
Frame: 1

// number of meshes
Meshes: 1

// mesh: name, flags, material index
"Box01" 0 0

// number of vertices
20

// vertex: flags, x, y, z, u, v, bone index
0 -10.375000 10.500000 13.750000 0.000000 0.000000 -1
0 -10.375000 -10.250000 13.750000 0.000000 1.000000 -1
0 10.375000 10.500000 13.750000 1.000000 0.000000 -1
0 10.375000 -10.250000 13.750000 1.000000 1.000000 -1
0 10.375000 10.500000 13.750000 0.000000 0.000000 -1
0 10.375000 -10.250000 13.750000 0.000000 1.000000 -1
0 10.375000 10.500000 -4.500000 1.000000 0.000000 -1
0 10.375000 -10.250000 -4.500000 1.000000 1.000000 -1
0 10.375000 10.500000 -4.500000 0.000000 0.000000 -1
0 10.375000 -10.250000 -4.500000 0.000000 1.000000 -1
0 -10.375000 10.500000 -4.500000 1.000000 0.000000 -1
0 -10.375000 -10.250000 -4.500000 1.000000 1.000000 -1
0 -10.375000 10.500000 -4.500000 0.000000 0.000000 -1
0 -10.375000 -10.250000 -4.500000 0.000000 1.000000 -1
0 -10.375000 10.500000 13.750000 1.000000 0.000000 -1
0 -10.375000 -10.250000 13.750000 1.000000 1.000000 -1
0 -10.375000 10.500000 13.750000 0.000000 1.000000 -1
0 10.375000 10.500000 13.750000 1.000000 1.000000 -1
0 -10.375000 -10.250000 13.750000 0.000000 0.000000 -1
0 10.375000 -10.250000 13.750000 1.000000 0.000000 -1

// number of normals
6

// normal: x, y, z
0.000000 0.000000 1.000000
1.000000 0.000000 0.000000
0.000000 0.000000 -1.000000
-1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 -1.000000 0.000000

// number of triangles
12

// triangle: flags, vertex index1, vertex index2, vertex index3, normal index1, normal index 2, normal index 3, smoothing group
0 0 1 2 0 0 0 1
0 1 3 2 0 0 0 1
0 4 5 6 1 1 1 2
0 5 7 6 1 1 1 2
0 8 9 10 2 2 2 1
0 9 11 10 2 2 2 1
0 12 13 14 3 3 3 2
0 13 15 14 3 3 3 2
0 12 16 6 4 4 4 3
0 16 17 6 4 4 4 3
0 18 13 19 5 5 5 3
0 13 7 19 5 5 5 3

// number of materials
Materials: 1

// material: name
"Material01"

// ambient
0.200000 0.200000 0.200000 0.800000

// diffuse
0.000000 0.501961 0.752941 0.800000

// specular
0.752941 0.752941 0.752941 0.800000

// emissive
0.000000 0.000000 0.000000 0.800000

// shininess
63.000000

// transparency
0.800000

// color map
"D:\Eigene Dateien\Image2.tga"

// alphamap
"D:\Eigene Dateien\Image1.tga"

// number of joints
Bones: 3

// name
"joint1"

// parent name
""

// joint: flags, posx, posy, posz, rotx, roty, rotz
0 0.250000 0.000000 0.000000 0.224024 1.570796 0.000000

// number of position keys
2

// position key: time, posx, posy, posz
1.000000 0.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000

// number of rotation keys
2

// rotation key: time, rotx, roty, rotz
1.000000 0.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000

"joint2"
"joint1"
5 0.000000 0.000000 20.256172 -1.015218 0.000362 3.141593
3
1.000000 0.000000 0.000000 0.000000
15.000000 0.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000
3
1.000000 0.000000 0.000000 0.000000
15.000000 2.286381 -0.000548 -0.000365
30.000000 0.000000 0.000000 0.000000
"joint3"
"joint2"
4 0.000000 0.000000 16.128391 0.000000 0.000000 0.000000
2
1.000000 0.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000
2
1.000000 0.000000 0.000000 0.000000
30.000000 0.000000 0.000000 0.000000


// you can build the joint matrix:
// - rotate an identity matrix by the rotation values of the joint
// - set the translation of the matrix to the position values.

// the same for key matrices

// the key matrices animate the reference matrices, so you have to multiply them,
// to get the final local joint matrix. The get the final global joint matrix,
// you have to multiply them by their parents.





It is a good start to load the ascii version, but IMO binary is better(take less space)... but i started with the ascii version too
Ramses

"I write messages on money. It''s my own form of social protest. A letter printed on paper that no one will destroy. passed indiscriminately across race, class and gender lines and written in the blood that keeps the beast alive. A quiet little hijacking on the way to the check-out counter. And a federal crime." Zack de la Rocha in Renegades.

Share this post


Link to post
Share on other sites