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 )
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
I don't think so, I didn't quiet follow what the maxscript did, I never got it to work either.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.
Yeah, it starts at 0x800, I kinda got it mixed up there..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