Results 1 to 30 of 652

Thread: A start on the .MESH file format

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default A start on the .MESH file format

    Hi

    I've been looking at the .MESH format and although it's not complete, I thought I'd share what I've found and maybe kickstart others to finish it.

    I've mainly been looking at figure meshes (siege engine and other meshes are a bit different) and the information relates to these. All values identified as integers are 4 byte integers.

    MESH files are stored as follows:-

    .at byte 69 of the initial header - integer value for number of different mesh groups = num_group

    .at byte 83 - start of first mesh group, integer showing length of mesh type (ie body ,arms, legs,etc) name string

    .mesh type name string

    .integer showing length of mesh group name(ie legs 01, arms 04, etc) string

    .mesh group name string

    .2 bytes of dummy data (only in first mesh group)

    .integer showing number of triangles in mesh group = n

    .n * 3 * 2 byte shorts for triangle values

    .29 byte header/footer (only between first and second mesh groups all others are 23 bytes)

    repeating below for 1 to num_group-1

    .integer - length of mesh type string

    .mesh type string

    .integer - length of mesh group name string

    .mesh group name string

    .integer showing number of triangles in mesh group = n

    .n * 3 * 2 byte shorts for triangle values

    .23 bytes of header/footer

    Then you have another 24 byte of header/footer

    .integer - number of vertices = n2

    .n2 * 2 * 4 byte float - texture coord u and v values (note here the uv values are based on a composite texture ie 2048 x 1024 - the figure texture on the left and the attachment texture on the right)

    .28 byte of header/footer

    .integer - number of vertices = n2

    .n2 * 2 * 4 byte float - vertex weights (primary weight, secondary weight - from left)

    .38 bytes of header/footer

    .integer - number of vertices = n2

    .n2 * 3 * 4 byte float - vertex vector

    .36 bytes of header/footer

    .integer - number of vertices = n2

    .vertex/bone assignments, information in series of four bytes - (from left) byte1 = 0, byte2 = secondary bone, byte3 = primary bone, byte4 = 0

    That's as about as far as I've got so far. There is another block of code following the vertex/bone assignments that I haven't worked out yet. It seems to be in series of three bytes followed by a zero byte - maybe something to do with shader systems - any ideas?

    After this block is just a listing of the skeleton bones in hierarchy order. Hopefully somebody can use this to go further.

    Cheers

    GrumpyOldMan
    Last edited by GrumpyOldMan; 02-14-2007 at 07:14.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO