XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sun Oct 22, 2017 6:14 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (._X3)
PostPosted: Mon Jul 17, 2017 6:12 am 
Offline
ultra-n00b

Joined: Thu Dec 10, 2015 2:04 pm
Posts: 6
Has thanked: 2 times
Have thanks: 2 times














You can make the ads go away by registering

I'm not that familiar with 3D formats, so I need help to convert model files (._X3) from Sora the 3rd to .obj or .ply files.
Here's a ingame screenshot a scene that contains the model:
Image
Another tool, called GameViewer, which is available at https://github.com/prefetchnta/gameviewer can view, but not export as 3D model, these model files:
Image

Here's a sample of the file + textures: https://transfer.sh/CG9oD/sora_3rd_sample.zip


Top
 Profile  
 
 Post subject: Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.
PostPosted: Mon Jul 17, 2017 8:32 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2154
Location: Nexus, searching for Jim Kirk
Has thanked: 424 times
Have thanks: 1097 times
uyjulian wrote:
Another tool, called GameViewer, [...] can view, but not export as 3D model, these model files
a viewer that doesn't have an export option? :D Very funny. :roll:

Anyways, the format appears to be simple, but there's about 721 assumed small submeshes (SMs) in the sample file.
So a script is required to gather them all.
You might try a 3D ripper on a scene loaded by that famous viewer, so that you can rip some meshes, hopefully.

I used hex2obj (view link in my sig) to get one of the bigger SMs displayed:


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.
PostPosted: Tue Jul 18, 2017 3:24 am 
Offline
ultra-n00b

Joined: Thu Dec 10, 2015 2:04 pm
Posts: 6
Has thanked: 2 times
Have thanks: 2 times
Thanks!
Image
Image
Image

I think all I need to do is figure out the space between CD3DFile_Mesh and the start of the vertices data.


Top
 Profile  
 
 Post subject: Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.
PostPosted: Tue Jul 18, 2017 6:40 pm 
Offline
ultra-n00b

Joined: Thu Dec 10, 2015 2:04 pm
Posts: 6
Has thanked: 2 times
Have thanks: 2 times
Here's my progress so far:
Image
https://gist.github.com/uyjulian/db43b5 ... 00bc78cfdc

Anybody know how to map textures?


Top
 Profile  
 
 Post subject: Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.
PostPosted: Tue Jul 18, 2017 8:05 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2154
Location: Nexus, searching for Jim Kirk
Has thanked: 424 times
Have thanks: 1097 times
well done, see you used python.

I wrote a short C program (not as short as your script :D ), same result:

texturing, iirc goes like this: select object, create material, apply texture. (Or simply open an image in UV/Image editor.)

Since there's so many submeshes (SMs) it would make sense to create mtl files via code.
But there's 21 .png textures only which are listed at the beginning of the _X3 file. So some grouping of SMs is required, I guess.

I tried to apply U70i1104.png (books) manually but I couldn't find a fitting uv map.

U70i3804.png appears to fit nicely. So that's maybe a way to find the connection between texture and mesh(es) in the _X3 file.

Code:
   cnt= 0 ;
   nValue[0]= 0; nValue[1]= 0; nValue[2]= 1; nValue[3]= 0; nValue[4]= 2; nValue[5]= 0;    // 0000 0100 0200
   do {
        offs2 = FindBytes(lpFBuf, j, dwFileSize-j, nValue, 6) ;       // j is offset here
        if (offs2!=0) {
            pFBuf += offs2 ; j += offs2 ;
            FIaddr_arr[cnt]= j ; pFBuf -= 4 ; j -= 4 ;
            GetDW(pFBuf, j, FIcnt, false) ; FIcnt_arr[cnt]= FIcnt ;
                //fprintf( stream, "# %3d 0x%x: %d\n", cnt, FIaddr_arr[cnt], FIcnt) ;
            if (cnt<1998) cnt++ ; else { chMB("Too many submeshes!\nbreak") ; j= dwFileSize ;}
        }
        { pFBuf += 7 ; j += 7 ; }     //
   } while ((offs2!=0)&&(j<dwFileSize)) ;
   FIaddr_arr[cnt]= dwFileSize ;        // wichtig für Endabfrage

   cntMax= cnt ; cnt= 0 ;   //
   do {
        log_FIs(stream, FIaddr_arr[cnt], minFaceInd, maxFaceInd, lastFaceInd, FIcnt_arr, cnt) ;
        addrV= FIaddr_arr[cnt] -4 - vCnt_arr[cnt] * 40 ; Vsum += vCnt_arr[cnt] ;
        fprintf( stream, "# vertex addr: 0x%x\n", addrV) ;
        log_Verts(addrV, vCnt_arr[cnt], 40) ; logUVs(addrV+32, vCnt_arr[cnt], 40) ;
        cnt++ ;
   } while (cnt<cntMax);
   fprintf( stream, "# vertex sum: %d\n", Vsum) ;


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.
PostPosted: Wed Jul 19, 2017 4:42 am 
Offline
ultra-n00b

Joined: Thu Dec 10, 2015 2:04 pm
Posts: 6
Has thanked: 2 times
Have thanks: 2 times
There appears to be multiple textures in a set of faces, and I have no idea which face goes with which texture.
Here's my progress so far:
https://gist.github.com/uyjulian/db43b5 ... 00bc78cfdc
Image
Here's some areas of the mesh area that I can't figure out:
Image
Image
Image


Top
 Profile  
 
 Post subject: Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.
PostPosted: Wed Jul 19, 2017 4:26 pm 
Offline
ultra-n00b

Joined: Thu Dec 10, 2015 2:04 pm
Posts: 6
Has thanked: 2 times
Have thanks: 2 times
Okay, so here's another sample:
https://transfer.sh/nu3jC/sora_3rd_2.zip

Image
The new sample was formatted a bit differently so I adjusted my script.
https://gist.github.com/uyjulian/db43b5 ... 00bc78cfdc


Top
 Profile  
 
 Post subject: Re: Trails in the Sky / Sora no Kiseki SC / th3rd 3D file (.
PostPosted: Thu Jul 27, 2017 5:52 am 
Offline
ultra-n00b

Joined: Thu Dec 10, 2015 2:04 pm
Posts: 6
Has thanked: 2 times
Have thanks: 2 times
Textures have been mapped!!!!
Image
New script at https://gist.github.com/uyjulian/db43b5 ... 00bc78cfdc

I'll make a blender plugin later


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users 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