Page 1 of 1

[request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 12, 2012 4:20 pm
by alon
The game developer is "THQ"
Textures: *.jpg
Mesh: *.cmfh
I was wondering if someone could create a Noesis plugin to import these files


Thanks in advance!

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 12, 2012 6:09 pm
by finale00
It's a simple format (parsing-wise), except in big endian........but I don't seem to be able to bind the buffers correctly.
Anyone have ideas?

http://db.tt/VkHl0r2Q

Code: Select all


struct Vertex {
   float[3] vx, vy, vz
   dword[12] ?
   float[3] nx, ny, nz
   float[2] tu, tv
}

struct Face {
   int16[3] v1, v2, v3
}

char[4] idstring
int32 ?
int32 numVerts
int32 numFaces

numVerts Vertex
numFaces Face

#a bunch of 4-byte integers afterwards

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 12, 2012 9:26 pm
by Karpati
Vertex structure:
3 floats (X,Y,Z)
15 floats unknown
2 floats (U,V)

I did try on all sample files with my program, but I can't load the desmodus.cmfh and the zarkon.cmfh files correctly.

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 12, 2012 9:31 pm
by Karpati
Is the full name of the game Voltron: Defender of the Universe ?

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 12, 2012 10:40 pm
by alon
Yes.
The title of the game is 'Voltron: Defender of the Universe'
I uploaded some more sample files

Re: [request]Voltron xbox360 cmfh to obj

Posted: Thu Feb 16, 2012 7:37 pm
by finale00
Cool, all I had to do was set BIG_ENDIAN option in noesis and it worked.

Code: Select all

rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
Right now I'm just assuming texName = {filename}, but that's not true. The material library is stored in {filename}_mat.txt, but I haven't bothered to look at it. If someone tells me the exact format I can just add a parser quickly.

There's also a second mesh format which I guess is for static meshes (you can see those in vehicles, rvm format)

Which is also pretty straightforward.

Image

Re: [request]Voltron xbox360 cmfh to obj

Posted: Fri Feb 17, 2012 7:44 am
by alon
Image
Thank you for your support.
Do you know how to fix this model?

Re: [request]Voltron xbox360 cmfh to obj

Posted: Fri Feb 17, 2012 8:02 am
by finale00
Nope. Not sure why some of the models are different. Not sure what the issue might be either.

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sat Feb 18, 2012 3:50 am
by alon
desmodus.cmfh(zarkon.cmfh, voltron_synthoid.cmfh, voltron.cmfh) was different from any other cmfh.

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 19, 2012 10:47 am
by Karpati
finale00 wrote:Nope. Not sure why some of the models are different. Not sure what the issue might be either.
You wrote: #a bunch of 4-byte integers afterwards

I think (hope) this format stores the model in the following format like this:

Vertexbuffer
Face buffer

Part Counter (4 bytes LongInt)

Parts:
Vertex_index_from (4 bytes LongInt)
Vertex_count (4 bytes LongInt)
Face_index_from (4 bytes LongInt)
Face_count (4 bytes LongInt)

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 19, 2012 8:15 pm
by finale00
Ya, you're right.

Code: Select all

int32 numGroups

numGroups {
    int32 offset into vertex buffer
    int32 numVerts
    int32 offset into index buffer
    int32 numFaces
    int32 unk
    int32 count
    int32[count] ?
}
byte[2] 01 01
Image

I don't know what all those other integers could mean though.

Btw, the material info is not really stored in the .mat file.
Unless it's incomplete.

I actually have no idea where the material info is.
But script is updated to load the meshes properly.

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 19, 2012 8:39 pm
by Karpati
Btw, the material info is not really stored in the .mat file.
Unless it's incomplete.
I actually have no idea where the material info is.
npc_arus.mat.txt file:

ch/human/npc/arus/arus_npc
endmats

arus_npc is the texture filename without file extension I think.
The real filename is arus_npc.jpg

Re: [request]Voltron xbox360 cmfh to obj

Posted: Sun Feb 19, 2012 8:44 pm
by finale00
For desmodus, it has _d and _a and _nm for the different types of texture maps.
Its mat.txt file only has that one line also.

There doesn't seem to be consistency either. If you look at zarkon it says _dm instead of _d lol