M2 / SKIN File Handling Question menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    hamunaptra's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    M2 / SKIN File Handling Question

    Hi yall

    I'm trying to extract the mesh data from an M2 in order to process it in another 3D-app (Blender). Since there is no working importer for Blender yet, I want to write it ...

    I've read the stuff in the Wiki about the format of the M2 and SKIN files and when I extract it the way I think I should, I get the right vertices but the wrong faces.

    Here's what I do:
    1. Open the M2 and get the count (@0x40) and offset (@0x3c) of the vertex list
    2. Read in all the vertices 0-n (position @ofs +i*48 and normal @ofs + i*48+0x14)

    This gives me the complete vertex list and it looks correct (if I plot them on the screen, the shape is recognizable).

    Now I try to get the mesh data from the associated SKIN file (00 for now):
    1. Open the SKIN and get the count (@0x04) and offset (@0x0 of the vertexindeces list
    2. Read all the vertexindices 0-n (vertexindex @ofs + i*2)
    3. Get the count (@0x0c) and offset (@0x10) of the triangles
    4. Read all the triangles 0-[n/3] (vertexindex1 @ofs + i*6, vertexindex2 @ofs + i*6 +2, vertexindex3 @ofs + i*6 + 4)

    Now I iterate through all the triangles and build the "real" triangles by using the 3 vertexindices of each triangle to look up the vertexindex in skin vertexindices list and then taking that to lookup the (final) vertex in the m2 vertexlist.

    When rendering, this looks... weird...

    What am I missing?

    Cheers

    Hamu

    M2 / SKIN File Handling Question
  2. #2
    schlumpf's Avatar Retired Noggit Developer

    Reputation
    755
    Join Date
    Nov 2006
    Posts
    2,759
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should include a screenshot of what you're getting.

  3. #3
    hamunaptra's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx, I managed to find the (stupid) typo where I was looking in the wrong part of the file for my triangles. That's fixed now... you can see the current status at www . riseofthemammoth . org (can't post links yet, rep too low)

    Cheers

    Hamu

  4. #4
    Tigurius's Avatar Member
    Reputation
    300
    Join Date
    Jun 2008
    Posts
    519
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out Startseite - MC-Addicts for a german modelediting community.
    Like my work? Support Me! ;D

Similar Threads

  1. Question for developers and those who know about M2, skin, DBC files....
    By sloth85 in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 04-09-2012, 04:07 PM
  2. swapping an item with multiple skin files?
    By skoopa in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 08-28-2010, 09:38 PM
  3. Skins.... I was wounder if you can edit the skin files
    By Srath47 in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 04-18-2010, 05:05 AM
  4. how to edit or convert .skin files
    By Danubis077 in forum WoW ME Questions and Requests
    Replies: 5
    Last Post: 04-16-2009, 05:58 AM
  5. [question]indexing skin files
    By houseplant2 in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 04-07-2009, 01:23 AM
All times are GMT -5. The time now is 01:03 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search