parsing milkshape files

Posted on 2009-12-29
Last Modified: 2013-12-14

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
Question by:sassek
    LVL 7

    Expert Comment

    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
    LVL 7

    Accepted Solution

    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.back(), sizeof(ms3d_vertex_t));

    Then do similar with triangles, groups, joints, materials, ...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now