parsing milkshape files


i was wondering if anyone could tell me how to parse milkshape files. I do not how to read the chunks like }ÄHÀ³Q±½"VD@½7 · ðÀ7`PEAto make them usefull. I want to do this using fstream.h and ifstreams.  have attached an example file
Who is Participating?
It is ms3d file format specified at

Use #include  and not fstream.h which is deprecated.

Goto project settings C++ code generation and switch alignment to 1-byte packed.

Open file with

    std::ifstream ms("model.dat", ios_base::binary | ios_base::in);

Then read first header

   ms3d_header_t msh;*)&msh, sizeof(msh));
Then number of vertices

  unsigned short numV;*)&numV, 2);

For each vertex read into vertext struct
    std::vector v;  
   for (unsigned short n = 0; n < numV; ++n)
       v.push_back(ms3d_vertex_t);*)&v.back(), sizeof(ms3d_vertex_t));

Then do similar with triangles, groups, joints, materials, ...
The milkshape files should be in binary format. Go through the following urls to get the details of that file format.

You can use the header file to get structure of that ms3d file format details.

John Nash
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.