Important information: this site is currently scheduled to go offline indefinitely by end of the year.

L.A. Noire heads

Post questions about game models here, or help out others!
Post Reply
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

L.A. Noire heads

Post by Tosyk »

trying to explore this meshes with hex2obj without luck. feeling lack of knowledge i assumed that ackerman_head.chunk mesh has several meshes inside and first of them starts from 0x66A4 and ends at 0x725C

but after that tutorial leads me in a totaly mess, where vertices and uvs flew away from logical area of where the data should stored, ex:
v -832981766051521080000000000000000000.000000 -0.000004 -0.002124
v 0.002808 -0.000001 0.000000
v 0.000000 0.000000 -56217600459076175000000000000000000.000000
v -4307986335116815300000000000000000000.000000 -0.000379 -0.000030
v 0.000109 -0.000000 0.000000
v 0.000000 0.000000 -24052315832927675000000000000000000.000000
v -11001165024864064000000000000000000000.000000 -0.000111 -0.000001
can anyone help me with this?
Thank you for all you do here
my blog | my forum
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: L.A. Noire heads

Post by shakotay2 »

Tosyk wrote:but after that tutorial leads me in a totaly mess, where vertices and uvs flew away from logical area of where the data should stored, ex:
the tutorial is assumed to be used on simple models only as L.A. Noire heads are not.

For more complex models there are further steps to be observed:
  • use TextureFinder to get a clue whether/where texture data might be contained
  • after you got the face indices list (what mostly seems to be the easiest part)
  • scroll carefully through the model file to determine different sections
If you know from the max face index that there should be 1000 vertices for example
you can calculate the size of a continuous vertex section: 0x2EE0 for floats
or 0x1770 for half floats in sequential mode. (For the blocked mode the size is
1000 * VBsize of course.)

For L.A. Noire I found the normals blocks so far; start addresses may be incorrect!
adams_head:
Image
For ackerman_head the H2O file is:
0x66A4 1500
VB1
36 99
0x3B38 309
0202

After knowing the normals section it may be easier to find the vertex positions.
Eiterh in the smae block or in another section.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
zaramot
double-veteran
double-veteran
Posts: 783
Joined: Wed Jan 05, 2011 12:41 pm
Has thanked: 39 times
Been thanked: 855 times

Re: L.A. Noire heads

Post by zaramot »

Quickly checked Adam's head, vertices appears to be shorts so the UV's. Vertex start at 0x3150, vertex size 36 bytes.
You do not have the required permissions to view the files attached to this post.
Making model-import scripts, PM
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: L.A. Noire heads

Post by shakotay2 »

enabling of the "cut" button is required, too.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: L.A. Noire heads

Post by Tosyk »

Wow, this looks great, will continue research later this evening.
Thank you for all you do here
my blog | my forum
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: L.A. Noire heads

Post by Tosyk »

Image

can u point me where is my error? for adams_head.chunk

can't get any positive result.

also I understand diferent sections in the files:

"garbage"
texture
vertextes
faces
texture dxt1 with mipmaps
normals?
"garbage"
Thank you for all you do here
my blog | my forum
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: L.A. Noire heads

Post by shakotay2 »

use WordAll

And then switch the cut button from "noCut" to "cut".
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: L.A. Noire heads

Post by Tosyk »

so i found this for adams_head.chunk:

Image

works perfectly, i found and extract it textures.

also, i assumed that vertex buffer consists of 24 bytes pattern and first float_3 it's CoordXYZ

now, how can i found uvs?
Thank you for all you do here
my blog | my forum
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: L.A. Noire heads

Post by shakotay2 »

(sry for this abandoned thread - as a known member of RodH club we like to grab it again :D )
yeah, see: Tosyk was right using half floats for the uvs (never could have imagined this ugly square uv map to give a decent head):
Adam_head.jpg
btw. FVF size is 36 here (former "VB size"). Also the "cut" option has been cut (ha-ha) from newer versions of hex2obj.
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: L.A. Noire heads

Post by shakotay2 »

here's a short (and ugly) maxscrript to load Adam's head chunk.
As you may know I prefer doing it in 'C' but Tosyk requested a maxscript:
(works for THIS head only!)

Code: Select all

fn readHalfFloat fstream = (
    hf=readshort fstream #unsigned
    sign = bit.get hf 16
    exponent = (bit.shift (bit.and hf (bit.hexasint "7C00")) -10) as integer - 16
    fraction = bit.and hf (bit.hexasint "03FF")
    if sign==true then sign = 1 else sign = 0
    exponentF = exponent + 127
    outputAsFloat = bit.or (bit.or (bit.shift fraction 13) \
    (bit.shift exponentF 23)) (bit.shift sign 31)
    return bit.intasfloat outputasfloat*2
    )


vertArray=#()
faceArray =#()
UVarray=#()

function ReadModelFile fName=
(     
    format "-- START READING MODEL FILE --\n"
    stream = fOpen fname "rb"          -- Open the file for reading
    fSeek stream 0x194 #seek_set
    vertCount = readlong stream       -- vertex count of (first) submesh
    faceCnt     = readlong stream
    vertStride= 36
	
    --print ("@ 0x"+ bit.intAsHex(ftell stream) as string)		

    fSeek stream 0x3150 #seek_set	-- vertex block
    for i=1 to vertCount do (		--
       x  = readShort stream #signed
       y  = readShort stream #signed
       z  = readShort stream #signed
       fSeek stream (26) #seek_cur
       tu  = readHalfFloat stream; tv  = readHalfFloat stream
       append vertArray ([x,y,z]/127.0)	
	   --format "v %\n" vertArray[i]
       append UVarray [tu,tv,0]		       
    )
    print ("@ 0x"+ bit.intAsHex(ftell stream) as string)
	
    for x = 1 to faceCnt do (
        fa= readshort stream #unsigned
        fb= readshort stream #unsigned
        fc= readshort stream #unsigned
            format "f % % %\n" fa fb fc
        append faceArray[fa+1,fb+1,fc+1]	
	)	
    msh = mesh vertices:vertArray faces:faceArray
    msh.numTVerts = vertCount
    buildTVFaces msh
    for j = 1 to vertCount do setTVert msh j UVarray[j]
    for j = 1 to faceCnt do setTVFace msh j faceArray[j]

    fClose stream
)

-- entry point --

ClearListener()
fname = getOpenFileName \
caption:" open L.A. Noire 3D Model" \
types:"3D Model (*.chunk)|*.chunk"
--historyCategory:"3D Model chunk
format "fname: %\n" fname
   
ReadModelFile fname
For other chunk files you'll need to adjust the start address of the vertices block (0x3150 here)
and (possibly) the address of the vertex count: 0x194
Adams_head_MS.jpg
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: L.A. Noire heads

Post by Tosyk »

shakotay2 wrote:here's a short (and ugly) maxscrript to load Adam's head chunk.
I'm greatly appreciate for this, shakotay :]
Thank you for all you do here
my blog | my forum
Post Reply