XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Thu Mar 30, 2017 5:58 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Help] Hex2obj
PostPosted: Thu Jul 28, 2016 9:48 pm 
Offline
n00b

Joined: Tue Oct 13, 2015 10:25 am
Posts: 12
Has thanked: 1 time
Have thanks: 0 time
Hi there...
I need help to find "Face indices" "vertices" and "UVs" from a simple 3d file format... I tried to look at the tutorial himself but i don't understand how they do it...
If someone have another tutorial or any help about hex2obj it will be very kind to show me it :oops:
Thanks


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Sat Jul 30, 2016 11:17 pm 
Offline
ultra-n00b

Joined: Tue Dec 29, 2015 10:55 pm
Posts: 6
Has thanked: 0 time
Have thanks: 0 time
Hello,
me too, i don't understand :)


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Sun Jul 31, 2016 5:12 am 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 1962
Has thanked: 344 times
Have thanks: 956 times
You should tell where you got stuck with the tutorial so that I can improve it.

There is no general recipe how to get the vertices, even for simple models.
For the face indices (FIs) the rule is: search for a scrambled alphabet.

Problem is: not every scrambled alphabet you find in 3D data represents FIs.

Simple 3D model formats use floats (4 bytes) for the vertices. (Half float vertices
or even shorts (WORD, 2 bytes) are harder to recognize.)

To find vertices (v) you'll need to find patterns.

From the tutorial it says:
v: xx xx xx nn with nn= 42..44 (these are rough values only, can also be 3F, 40)

where v is a 4 bytes little endian value.
And 'yes', nn can also be 3D, 3E, or even 37 - my bad.
(Also BD if the MSB is set but that's beyond this tutorial.)

Don't know what this is: bytes, floats, endianess? Google for it.

But you don't need to know it. All you have to know is how to recognize patterns.
(If you can't: well, then you're lost - as simple as that.)

Let's have another look at the tutorial sample, hw_bu_000.bm.mod

The scrambled alphabet is to be found somewhere at file offset 0x3B00.
These face indices are integer numbers - they just count the vertices.

The integers consist of two bytes here. 20 00 (little endian) is 0x0020 or 32 decimal.

First vertex has the number 00 so search for the start of the face indices list
at 0x398D. There it reads 00 00 01 00 02 00, this is 0, 1, 2 in decimal.

This means that the vertices 0, 1 and 2 are used to construct the first face (triangle)
of the model.

(Won't bother how to find the end of the face indices list. It's at 0x4844.)

Now for the vertices - I've randomly marked some of them by rectangles:
You'll find the start address 0x56 by experience or trial & error.

In hex2obj toggle the 'noPtC' (no PointCloud) button to 'PtCld'.

Enter 56 (without the 0x) as vertices startaddress in step 3.
Leave the mode button in step 2 as 'seq' (sequential).
Press the 'mesh' button.

The point cloud of the upper body pops up.

Enter 398D as a face indices start address in step 1. Switch back to 'noPtC'.
Change the count from 500 to 100 or 150, as you wish.

Scroll down in the lower left list box. It reads: max face index: 142.
Enter this value as a count in step 3.

Press the 'go3' button. You happen to see a mesh, don't you?

Looks broken? Yeah, because we didn't use all FIs.

Calculate the number of FIs in two steps: a) you've to subtract the FIs' startaddress (0x398D)
from the endaddress+1 (0x4845) -> 0xEB8= 3768 bytes.

That's the size of the face indices block. b) Divide it by two (since the FIs
are two byte integers) -> FIs count= 1884.

hex2obj: enter 1884 as a count in step 1. Press 'go1', in the listbox there's a
max face index of 457 displayed. It's the highest vertex number.
So we enter this value as a count in step 3.

Pressing 'go3' shows the full upper body of the model.


Attachments:


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


_________________
Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm8.zip

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


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Tue Aug 02, 2016 1:01 am 
Offline
n00b

Joined: Mon Jun 06, 2016 7:51 pm
Posts: 16
Has thanked: 5 times
Have thanks: 3 times
shakotay2 ,

I'm also "stuck" in your tutorial at the "start address of normals" step:

Previous we getting the size of the uv list = 0xE48

Next, in searching of the uvs start addresses you explain so We should "calculate back" from 12 bytes before, subtract 0xC from FIStart (0x398D), subtract 0xE48 from result and get 0x2B39.

Size of normals list is 0x156C

But for getting the start addresses of normals we need 0x2B2E - 0x156 = 0x15C2.
How obtained 0x2B2E instead 0x2B39?
0x2B2E that's 0x2B39 - 0xB?
You not explain it in tutorial.


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Tue Aug 02, 2016 5:41 am 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 1962
Has thanked: 344 times
Have thanks: 956 times
devmode wrote:
But for getting the start addresses of normals we need 0x2B2E - 0x156 = 0x15C2.
How obtained 0x2B2E instead 0x2B39?
0x2B2E that's 0x2B39 - 0xB?
You not explain it in tutorial.
I didn't feel the necessity to explain that because it's plain to see when looking at
hw_bu_000.bm in a hex editor. It's just a string (and a DWord, the length) to skip:


Attachments:


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


_________________
Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm8.zip

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


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Tue Aug 02, 2016 10:00 pm 
Offline
n00b

Joined: Mon Aug 01, 2016 1:46 am
Posts: 17
Has thanked: 2 times
Have thanks: 2 times
As a fellow noob who just had an epiphany about all this in the past 24 hours maybe I can help out. Can you attach a copy of the file you're trying to work with?


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Sun Aug 21, 2016 12:03 pm 
Offline
advanced

Joined: Sun Aug 21, 2016 12:00 am
Posts: 44
Has thanked: 22 times
Have thanks: 17 times
What if the format is saved in a way that the face indices first then the UV list? The tutorial assumes that the file format is UV list first then face indices right? because the start address is calculated by subtracting from the start address of the face indices?


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Sun Aug 21, 2016 2:59 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 1962
Has thanked: 344 times
Have thanks: 956 times
majidemo wrote:
What if the format is saved in a way that the face indices first then the UV list?
should not matter because you enter the addresses for FIs and uvs independently.

Quote:
The tutorial assumes that the file format is UV list first then face indices right?
It does for the tutorial sample.
Quote:
because the start address is calculated by subtracting from the start address of the face indices?
This is just for the tutorial .bm sample that is sequential (was one of the first formats I used hex2obj on). (Meanwhile I experienced that most formats use 'blocked' or 'mixed' mode.)

Finding the uvs' start address in sequential mode is a "matter of experience" (as you can read in the tut).
It also says that there's no common recipe but 'yes', you normally are on a promising track of finding uvs' start address in sequential mode when
subtracting the uvs' block size from the FIs' start address.

_________________
Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm8.zip

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


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Mon Nov 07, 2016 6:11 pm 
Offline
ultra-n00b

Joined: Mon Nov 07, 2016 6:00 pm
Posts: 3
Has thanked: 2 times
Have thanks: 0 time
Hi, I copy your tutorial and post in the Zenhax forum.
Dont worry, i say that no was me who created the H2O and the tutorial.
i just copy and paste there, because not have tutorials about it.
And i have a question too:
I want to access the game models of the ratatouille game, i had make a tutorial about "how to replace textures of the any game, simple using hexeditor, dragon upacker and paint." But i dont know how to open the game models for replace them.
If i decompile the game folder i can extract the meshes of character, objects, map?
With your program?
Or not?
Thank you so much!
http://zenhax.com/viewtopic.php?f=4&t=3351


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Mon Nov 07, 2016 6:48 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 1962
Has thanked: 344 times
Have thanks: 956 times
Sckoofer wrote:
Dont worry, i say that no was me who created the H2O and the tutorial.

I would not worry even if you told it were yours. :D

Quote:
If i decompile the game folder i can extract the meshes of character, objects, map?

depends on - you'll need to upload a supposed model file.

_________________
Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm8.zip

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


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Mon Nov 07, 2016 11:44 pm 
Offline
ultra-n00b

Joined: Mon Nov 07, 2016 6:00 pm
Posts: 3
Has thanked: 2 times
Have thanks: 0 time
Thank you so much.
Here https://mega.nz/#!5VZDyQDQ!RK5PeSiLbTvhLu4z0iVKLdDxegIA-HC3wsWfFWonTto
I cannot download more on mega, but i can upload! :[
If dont work: http://www.4shared.com/file/TD8Lbylnce/CT_online.html
See for me if i can extract the models, or not.
And the more important, if i can change the coordinates of the objects, and how to do it. :mrgreen:
Thank you so much again.


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Tue Nov 08, 2016 7:23 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 1962
Has thanked: 344 times
Have thanks: 956 times
Sckoofer wrote:
See for me if i can extract the models, or not.
CT.DPC contains hundreds of DXT1, DXT5 strings.
So may contain textures, maybe compressed
Quote:
And the more important, if i can change the coordinates of the objects, and how to do it. :mrgreen:

that's not a matter of hex2obj - it's modding; look for threads/ forums which deal with that, please.

_________________
Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm8.zip

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


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Tue Nov 08, 2016 9:30 pm 
Offline
ultra-n00b

Joined: Mon Nov 07, 2016 6:00 pm
Posts: 3
Has thanked: 2 times
Have thanks: 0 time
:(.
WAIT! I won decompile the file! With quickBMS.Please, help me, just one more time :cry:
http://www.4shared.com/rar/lI3zlRM_ce/CT_decompiled.html
Please, you are my last hope.


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Sat Dec 10, 2016 12:21 am 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 1962
Has thanked: 344 times
Have thanks: 956 times
chunk files; continuing from this thread:
viewtopic.php?f=16&t=13675&start=45

@ekmek: handling the chunk file
I show the steps which should be plain to see for any noob;
if you don't, well, then I fear I can't help.

address 0x5CCE0: start of face indices (FI) list

search for 000001000200, next addresses 0x63F28 and 0x65D88, assumed starts of FIs lists

size of first submeshes FIs' list:
0x63F28 -0x5CCE0= 0x7248= 29256

FIs count: 14628 (words= 2 bytes per index)
resulting in a vertex count of 4848 (lower left listbox)

Finding the FVF size; well, that requires some experience;
you'll gain it after having dealed with some dozens of different mesh formats:

from a glance at the beginning of the file I'd guess for 44.

ShortAll didn't work here, so I switched to half floats.


Getting the uvs positon is another hurdle for most people; use "trial 'n error"
if the standard addresses for ShortAll/HF formats (from 12, in multiples of four, 16, 20 etc.) don't work.

In this case it's 40.


Attachments:


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


_________________
Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm8.zip

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


Top
 Profile  
 
 Post subject: Re: [Help] Hex2obj
PostPosted: Sat Dec 10, 2016 12:54 am 
Offline
ultra-n00b

Joined: Mon Nov 28, 2016 7:53 pm
Posts: 7
Has thanked: 0 time
Have thanks: 0 time
Thanks! That makes more sense. Let me mess around with it


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

All times are UTC + 1 hour


Who is online

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