Editing some other files with hex editor

Any progress? I really don't understand how they keep face index, they are many repeats.. and the maxscript importer doesn't calculate the normals corectly
 
I looked at the model format over the last few days, I already got some stuff working, including UV-coords and Normals (For those interested, the normals are stored in the 3 bytes after the position floats, so only 1 byte for each axis)

Obligatory screenshot: (Textures don't get loaded yet, but they should work):
sr3.png

I don't know if I'll ever get stuff back into the game, for that I'd have to know a lot more about the format. At the moment there's some stuff I'm just skipping over because I have no clue what it's for..

(Also props to the admins for allowing steam login, always nice to see that ;) )
 
I looked at the model format over the last few days, I already got some stuff working, including UV-coords and Normals (For those interested, the normals are stored in the 3 bytes after the position floats, so only 1 byte for each axis)

Obligatory screenshot: (Textures don't get loaded yet, but they should work):

I don't know if I'll ever get stuff back into the game, for that I'd have to know a lot more about the format. At the moment there's some stuff I'm just skipping over because I have no clue what it's for..

(Also props to the admins for allowing steam login, always nice to see that ;) )

What about the faces, do you read in the same way the maxscript reader does?

PHP:
StartDirection = -1
f1 = readshort s #unsigned + 1
f2 = readshort s #unsigned + 1
if f1>=count3 do f1=1
if f2>=count3 do f2=1
FaceDirection = StartDirection
IndexCounter = 2
Do (
f3 = readshort s #unsigned
 
IndexCounter += 1
if f3>=count3 then (
f1 = readshort s #unsigned + 1
f2 = readshort s #unsigned + 1
if f1>=count3 do f1=1
if f2>=count3 do f2=1
FaceDirection = StartDirection
IndexCounter += 2
) else (
f3 += 1
FaceDirection = -FaceDirection
if (f1!=f2)AND(f2!=f3)AND(f3!=f1) then (
if FaceDirection > 0 then append faceArray [f1,f2,f3]
else append faceArray [f1,f3,f2]
)
f1 = f2
f2 = f3
)
)
while IndexCounter !=count5
 
What about the faces, do you read in the same way the maxscript reader does?
I don't think so, I didn't quiet follow what the maxscript did, I never got it to work either.
If you look at position 0x801 in the file shaundi.ccmesh_pc you'll find a list of 28*4 dwords, each of these 28 entries represent parts of the model and their LOD's. One of the values is the starting index (I think the second dword), the next one is the number of vertices it contains. So I'm basicly just skipping to the position of the index and read the specified number of verticies, It's still a triangle strip though, so you might have to deal with degenerate polygons.
 
So does the game auto-adjust textures to fit across faces, or does twisting the model about require adjusting the textures like mad? Or have you not managed to actually get it to adjust the shape and not crash entirely?
(I'm not a 3d modeller, so I'm not sure what's involved in all of this)
 
I don't think so, I didn't quiet follow what the maxscript did, I never got it to work either.
If you look at position 0x801 in the file shaundi.ccmesh_pc you'll find a list of 28*4 dwords, each of these 28 entries represent parts of the model and their LOD's. One of the values is the starting index (I think the second dword), the next one is the number of vertices it contains. So I'm basicly just skipping to the position of the index and read the specified number of verticies, It's still a triangle strip though, so you might have to deal with degenerate polygons.

Thanks, for reply, I'll try it, can you share the source code of your reader?
Btw, did you mean 0x800? as I can see they are 16B aligned
 
Thanks, for reply, I'll try it, can you share the source code of your reader?
Btw, did you mean 0x800? as I can see they are 16B aligned
Yeah, it starts at 0x800, I kinda got it mixed up there..
I'd love to release the code but currently it's a huge mess, since I started writing that thing without really knowing much about the format, so a lot of trash piled up over time.. Once I figure out how the bones work I'll probably rework the whole thing in a more elegant matter which I could release into the wild ;)
 
Thanks, for reply, I'll try it, can you share the source code of your reader?
Btw, did you mean 0x800? as I can see they are 16B aligned

Actually from my experimentation I think the data structures are aligned to 8 bytes.
 
At the moment I'm sometimes aligning to 8 and sometimes to 16 bytes, not sure whats up with that..
I made some progress with the bones, although at the moment it only works a few models and even on these it's still not perfect:
weights.png

(As you can see, for some reason the leg influences the hair, but apart from that everything works pretty well. Also the bones aren't pointing in the right direction, but that doesn't really matter at the moment)
UV coordinates work well too, now that i've written a crappy exporter I could actually put some textures on the model:
uvmap.jpg
 
Great progress.
Maybe you'll not like the idea, but maybe making and open source project on this exporter/(importer) could help speeding up the analyzing, as more people will be involved in the progress already made
 
Back
Top