Post questions about game models here, or help out others!
mega-veteran Posts: 209
Joined: Sat Feb 05, 2011 1:41 am
Been thanked: 1 time

Wow great work niceflarer

chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

the whole model format is dead easy its almost the same as obj. just need the header sorted out to reach the offset table then you can import anything.
You do not have the required permissions to view the files attached to this post.

nightFlarer
beginner
Posts: 33
Joined: Thu May 13, 2010 8:25 am
Has thanked: 4 times
Been thanked: 2 times

dammit chrrox, did you have to rain on my parade!? XD hehe

yeah, its quite easy, but I can't find the uv info.

This is what I have so far.

Code: Select all

``````f = fopen "_.geo" "rb"
clearlistener()
fscale=100

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
)

Face_array=#()
Vert_array=#()
UV_array=#()
Normal_array = #()

fseek f 0x0380 #seek_cur

fseek f 0x400 #seek_set

for x = 1 to vertcount do(

append Vert_array([vx,vy,vz]*fscale)
append UV_array[p4,p5,0]
)

Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
fseek f faceoff #seek_set

for x = 1 to face/3 do(
append Face_array[fa,fb,fc]
)
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))

msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
for j = 1 to UV_array.count do setTVert msh j UV_array[j]
for j = 1 to Face_array.count do setTVFace msh j Face_array[j]

Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
gc()
fclose f
``````

mega-veteran Posts: 209
Joined: Sat Feb 05, 2011 1:41 am
Been thanked: 1 time

Wow chrrox
claps slowly
Wooow fantastic

chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

try changing some of the flaots your reading to half floats for uv's.
also dante's inferno is the same format
You do not have the required permissions to view the files attached to this post.

mega-veteran Posts: 209
Joined: Sat Feb 05, 2011 1:41 am
Been thanked: 1 time

Thanks for the info chrrox

mehdichallenger
ultra-n00b
Posts: 3
Joined: Fri Sep 24, 2010 8:20 pm

hi everyone, im newbie and i wonder how can i extract the original models from game datas
it would be great if u tell me with full details plz i need to do that,i need models from dead space 1 and 2
and if there is without UV plz tell me cuz i dont have any problem with UV.
thx

renato
beginner
Posts: 21
Joined: Wed Nov 03, 2010 2:16 am
Has thanked: 3 times
Been thanked: 1 time

@mehdichallenger

Do you want the models to make a costume?(like me )

nightFlarer
beginner
Posts: 33
Joined: Thu May 13, 2010 8:25 am
Has thanked: 4 times
Been thanked: 2 times

Chrrox, it seems that I have failed lol
I tried all possible half floats for the uvs, but they either give me nothing or a randomly huge mess. Maybe the half float function is wrong? (the function is in the script above).

I'm so close to finishing, this the only thing that needs to be done.

chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

post what you have and i can make some pointers / help

nightFlarer
beginner
Posts: 33
Joined: Thu May 13, 2010 8:25 am
Has thanked: 4 times
Been thanked: 2 times

Thanks chrrox

Still similar to the last one I posted, as I said I tried all half floats so hopefully you'll find something wrong in my script haha.

Code: Select all

``````f = fopen "C:\\Users\\Paul Mahoney\\Downloads\\0144_torsoupper.geo" "rb"
clearlistener()
fscale=100

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
)

Face_array=#()
Vert_array=#()
UV_array=#()
Normal_array = #()

fseek f 0x0380 #seek_cur

fseek f 0x400 #seek_set

for x = 1 to vertcount do(

append Vert_array([vx,vy,vz] * fscale)
append UV_array[p4,p5,0]
)

Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
fseek f faceoff #seek_set

for x = 1 to face/3 do(
append Face_array[fa,fb,fc]
)
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))

msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
for j = 1 to UV_array.count do setTVert msh j UV_array[j]
for j = 1 to Face_array.count do setTVFace msh j Face_array[j]

Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
gc()
fclose f
``````

chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

fn convertTo32 input16 = (
inputAsInt = input16
sign = bit.get inputAsInt 16
exponent = (bit.shift (bit.and inputAsInt (bit.hexasint "7C00")) -10) as integer - 16
fraction = bit.and inputAsInt (bit.hexasint "03FF")
if sign==true then sign = 1 else sign = 0
exponentF = exponent + 127
--Ouput 32 bit integer representing a 32 bit float
outputAsFloat = bit.or (bit.or (bit.shift fraction 13) (bit.shift exponentF 23)) (bit.shift sign 31)
--Output Check
return bit.intasfloat outputasfloat
)

)

nightFlarer
beginner
Posts: 33
Joined: Thu May 13, 2010 8:25 am
Has thanked: 4 times
Been thanked: 2 times

I'm still getting the same results Perhaps the UV info is somewhere else?

chrrox
Moderator
Posts: 2564
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1308 times

its stored as floats right after the face data.
You do not have the required permissions to view the files attached to this post.

nightFlarer
beginner
Posts: 33
Joined: Thu May 13, 2010 8:25 am
Has thanked: 4 times
Been thanked: 2 times