XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Tue Oct 16, 2018 9:27 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Wed Feb 12, 2014 11:34 pm 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Mon Sep 26, 2011 12:51 pm
Posts: 364
Has thanked: 13 times
Have thanks: 122 times

Does the treasure chest animate ?
If so, maybe there is a reference to a bone or something, so that the cover of the chest is placed relevant to that position.

Btw, nice progress

T

You can make the ads go away by registering


_________________
My Game Dev Blog
My Starcraft II Mod files and scripts


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Sat Feb 22, 2014 5:46 pm 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
Yes, the chest has an animation. Idont know anything about bones however... do u know some tut that explains what it is and/or what to look for when reversing them? Its so annoying to be so close and still not be able to understand how the damn format works. Actually the section I do not understand has indices that seem to be mesh indices and those are followed by floats, does that sound like bone structure to you?

Also there seems to be a structure, the section always goes like this:
Code:
<mesh index> <float x> <float y> <float z>
<mesh index> <float x> <float y> <float z>
<mesh index> <float x> <float y> <float z>
...


And judging from the order of the indices I'm guessing there is hierarchy in the order they appear.

Also sometimes there's just that and sometimes there's a "FF FF FF FF" separator and then another section. like this for example:
Code:
<mesh index> <float x> <float y> <float z>
<mesh index> <float x> <float y> <float z>
<mesh index> <float x> <float y> <float z>
...
FF FF FF FF
<mesh index> <float x> <float y> <float z> // Sometimes the mesh index has already been mentioned earlier in the section, which is strange
<mesh index> <float x> <float y> <float z>
<mesh index> <float x> <float y> <float z>
...


Btw ill be on vacation soon so ill have more time to look into this


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Mon Feb 24, 2014 11:05 pm 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Mon Sep 26, 2011 12:51 pm
Posts: 364
Has thanked: 13 times
Have thanks: 122 times
I think the MeshIndex x y z refers to bones?

T.

_________________
My Game Dev Blog
My Starcraft II Mod files and scripts


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Wed Feb 26, 2014 6:39 pm 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
TaylorMouse wrote:
I think the MeshIndex x y z refers to bones?

T.

ty for help. Btw sry for my ignorance but is bone description alone sufficient to place the cover over the chest or eg a foot at the end of a leg?


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Wed Feb 26, 2014 9:09 pm 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Mon Sep 26, 2011 12:51 pm
Posts: 364
Has thanked: 13 times
Have thanks: 122 times
probably not, you should have some vertex weights somewhere, with an index to one or more bones, probably a fixed number of bones but not more than 4


T.

_________________
My Game Dev Blog
My Starcraft II Mod files and scripts


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Thu Feb 27, 2014 12:40 pm 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
I have a very weak 3d background, but is what you're telling me related to this http://www.misfitcode.com/misfitmodel3d ... tails.html ?

Quote:
A bone joint is is an object that forms one part of a model's skeletal structure. The root bone joint has no parent joint, all other joints have one parent. A parent joint may have multiple children.

Vertices and points may be attached to bone joints to control their movements during skeletal animations. When a vertex or point's movement is controlled by a bone joint, the bone joint is said to be an "influence". Vertices and points may have up to four influences.


I have trouble finding a simple explanation about bones/joints and how they work :oops:


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Sun Mar 02, 2014 12:56 am 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
Continuing research... I've tidied up my (incomplete) CHR specification if anyone wants to have a look at the format.

Code:
Consists of chunks and subchunks, with 4 bytes for the chunk ID, 4 bytes for the chunk size and the next bytes for the chunk data.

0x8000: Root chunk
   +4   long   chunk size
   
   0x18000: unknown purpose chunk
      +4   long   chunk size

      0x7f01: unknown purpose chunk
         +4    long      chunk size
         +8    long      N
         +12   long[N]   unknown long array

      0x7f03: Model chunk (contains submeshes)
         +4    long   chunk size
         +8    long   submesh count
         +12   long   model ID (first submesh ID)
         
         0x7f02: Submesh
            +4                      long                   chunk size
            +8                      long                   1
            +12                     long                   submesh ID
            +16                     long                   0
            +20                     long                   vertice count VC
            +24                     long                   polygon count PC
            +28                     long                   PC again ?
            +32                     long                   unknown
            +36                     long                   unknown
            +40                     float[3]               submesh center
            +52                     char[64]               unknown (sometimes contains a string eg. "amera02" or "C:\3DS4")
            +116                    float[3 * VC]          vertices
            +116 + 12 * VC          float[3 * PC]          normals
            +116 + 12 * (VC + PC)   (struct polygon)[PC]   {char unknown, char polygonIndex, char pVerticeCount, char unknown, long unknown, (long vertexIndex, long unknown, long unknown, long unknown) * pVerticeCount}

      0x7f04: Model texture

      0x7f05: Bones ?
         +4    long         chunk size
         +8    long         unknown
         +12   long         unknown
         +16   byte[4]      0
         +32   (struct)[]   {long index, float x, float y, float z}, the structs are sometimes interleaved with FF FF FF FF and 12 null bytes inbetween...
         
      0x7f06: unknown purpose chunk (seems to be groups of submeshes)



Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Tue Mar 04, 2014 8:38 pm 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
I'm trying to understand the 057f and 067f sections and things are getting very tricky :evil: . For TREASURE.CHR it's quite simple:

TREASURE.CHR, 057f:
Code:
0: 0, 0, 0
1: 0, 80, -50
2: 0, 0, 100

and the 067f:
Code:
3576
3578
3577

The values above are submesh IDs, when offsetting the submeshes in this order, relative to the previous submesh (ie 3576 offset with (0, 0, 0), 3578 offset with (0, 80, -50) and 3577 offset with (0, 80, 50)) then the cover and the lock are placed perfectly. But when looking at BAT.CHR things are not as easy:

BAT.CHR, 057f:
Code:
0 :  0      -0.3    0.68
1 :  0      0.3     -0.7
2 :  0      0.17    32.5
3 :  0      0       7.6
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
2 :  13.5   -0.22   -1.7
24:  21     0.1     16.1
2 :  -12.3  -0.3    -2
26:  -22    0.6     17.2
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
-1:  0      0       0
25:  28.7   0.1     7.75
27:  -28.5  -0.35   6.6

and the 067f:
Code:
11874, 11865, 11864, 11875
19 * null
11873
11872
11869
11868
16 * null
11870, 11871
11866, 11867


I'm not even posting the values for DAVID.CHR because it's even messier... I don't think this structure looks like a bone matrix :?: has anyone seen something like this in another format ? Looks like somekind of C array since there are sizes before both sections but I just can't make sense of it because the indexes don't make sense, apart from the fact that contiguous indexes (24,25,26 etc) seem to have to do with parenting... Halp please :cry:


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Sun Jun 08, 2014 6:27 pm 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
Gave it another shot today, been focusing on UVs. I know where they are and I have these UVs for the face of the "inside" of the chest:
Code:
F4 38 00 00 7A 1C 00 00
D0 C6 3B 00 7A 1C 00 00
D0 C6 3B 00 68 E3 1D 00
F4 38 00 00 68 E3 1D 00

I've also managed to extract the texture:

Image

Now from this texture, the real coords should be something like this (the order may be wrong but the numbers are the correct ones):
Code:
100,0
160,0
160,30
100,30

Now does anyone know how to convert the ints I've found to the real coords? thx :)


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Sun Jun 08, 2014 9:18 pm 
Offline
mega-veteran
mega-veteran

Joined: Wed Aug 02, 2006 10:07 pm
Posts: 316
Has thanked: 10 times
Have thanks: 93 times
absolute pixel coordinate, mate!

_________________
No more Fatduck, no more FatImporter, Byebye everyone!


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Sun Jun 08, 2014 10:35 pm 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
fatduck wrote:
absolute pixel coordinate, mate!

I'm not sure I understand what you mean:

F4 38 00 00 7A 1C 00 00 = 14580, 7290
D0 C6 3B 00 7A 1C 00 00 = 3917520, 7290

How do I get to 100, 0 and 160, 0 from there ? its not even proporsional :scaredy:


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Mon Jun 09, 2014 11:55 am 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Mon Sep 26, 2011 12:51 pm
Posts: 364
Has thanked: 13 times
Have thanks: 122 times
He means that the values you got are absolute pixel coordinates, meaning that you need to convert them to uv coordinates

ex. If the texture is 256 wide, and you pixel coordinate is 160 then the uv coordinate is 160/256 = 0,625

T.

_________________
My Game Dev Blog
My Starcraft II Mod files and scripts


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Mon Jun 09, 2014 12:13 pm 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
TaylorMouse wrote:
He means that the values you got are absolute pixel coordinates, meaning that you need to convert them to uv coordinates

ex. If the texture is 256 wide, and you pixel coordinate is 160 then the uv coordinate is 160/256 = 0,625

T.

yes sure I understand that, but the values I posted (100, 0; 160, 0 etc) are the pixel values I SHOULD find, but the corresponding values in the CHR are 14580, 7290; 3917520, 7290 etc and I don't know how to convert those to absolute pixel coords. Sorry if I'm missing something here but I can't find how to do that :?:


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Thu Jun 12, 2014 8:18 pm 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Mon Sep 26, 2011 12:51 pm
Posts: 364
Has thanked: 13 times
Have thanks: 122 times
Ah, ok, I think that we both misunderstood you.

What makes you think that the data should point to the texture coordinates?

T.

_________________
My Game Dev Blog
My Starcraft II Mod files and scripts


Top
 Profile  
 
 Post subject: Re: Silver 3d models and animations (CHR and ANM files)
PostPosted: Sat Jun 14, 2014 12:48 pm 
Offline
beginner

Joined: Sun Dec 29, 2013 4:46 pm
Posts: 36
Has thanked: 0 time
Have thanks: 8 times
nvm



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bluehydraz and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group