- Joined
- Mar 30, 2007
- Messages
- 745
- Reaction score
- 34
Hey all
Ok, newest project: A geometry binary (*.gb) viewer, in C#
So far it can render, which you can see on following image
The project is made by phantom's specifications for the GB file layout, here is the latest version:
The project will be open source when complete. Credits to phantom for the help so far.
P.S. I'm also planning on building in a texture-edit function, so you can easy change the filename of the textures.
And remember that you can use PNG,GIF,TGA instead of converting to GTX every time, it's not nessary![Eek! :eek: :eek:](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
Ok, newest project: A geometry binary (*.gb) viewer, in C#
So far it can render, which you can see on following image
![DeathArt - Geometry Binary Viewer (C#) - RaGEZONE Forums DeathArt - Geometry Binary Viewer (C#) - RaGEZONE Forums](http://web27190.web08.talkactive.net/upload/files/gbv3.png)
The project is made by phantom's specifications for the GB file layout, here is the latest version:
PHP:
[GBHeader (Version: 8; Size: 39; Reference: GBHeader - Version 12)]
Offset (Bytes) Length (Bytes) Reference Offset
--------------- --------------- -----------------
0 4 0
4 4 72
8 12 76
20 2 100
22 2 102
24 2 104
26 2 106
28 2 108
30 2 110
32 2 116
34 1 118
35 2 120
37 2 122
[GBHeader (Version: 9; Size: 72; Reference: GBHeader - Version 12)]
Offset (Bytes) Length (Bytes) Reference Offset
--------------- --------------- -----------------
0 4 0
4 4 72
8 24 76
32 2 100
34 2 102
36 2 104
38 2 106
40 4 108
44 4 112
48 2 116
50 1 118
51 1 119
52 2 120
54 2 122
56 16 148
[GBHeader (Version: 10; Size: 76; Reference: GBHeader - Version 12)]
Offset (Bytes) Length (Bytes) Reference Offset
--------------- --------------- -----------------
0 4 0
4 4 4
8 4 72
12 24 76
36 2 100
38 2 102
40 2 104
42 2 106
44 4 108
48 4 112
52 2 116
54 1 118
55 1 119
56 2 120
58 2 122
60 16 148
[GBHeader (Version: 12; Size: 164)]
Description Length Type Offset Comments
------------------------------ ------- ------- ------- ----------------------
Version 1 UInt8 0 12
Bone Count 1 UInt8 1
Bone Identifier 1 UInt8 2
Material Count 1 UInt8 3
Checksum 4 UInt32 4
File Name 64 String 8 Encrypted
File Name Length 4 UInt32 72
Total Vertex Count 0 2 UInt16 76 XYZ | NORMAL | TEX1 = 32
Total Vertex Count 1 2 UInt16 78 XYZ | LASTBETA_UBYTE4 | NORMAL | TEX1 = 36
Total Vertex Count 2 2 UInt16 80 XYZB2 | LASTBETA_UBYTE4 | NORMAL | TEX1 = 40
Total Vertex Count 3 2 UInt16 82 XYZB3 | LASTBETA_UBYTE4 | NORMAL | TEX1 = 44
Total Vertex Count 4 2 UInt16 84 XYZB4 | LASTBETA_UBYTE4 | NORMAL | TEX1 = 48
Total Vertex Count 5 2 UInt16 86 XYZB5 | LASTBETA_UBYTE4 | NORMAL | TEX1 = 52
Total Vertex Count 6 2 UInt16 88 Always 0
Total Vertex Count 7 2 UInt16 90 Always 0
Total Vertex Count 8 2 UInt16 92 Always 0
Total Vertex Count 9 2 UInt16 94 Always 0
Total Vertex Count 10 2 UInt16 96 Always 0
Total Vertex Count 11 2 UInt16 98 Always 0
Total Index Count 2 UInt16 100 Total_Index_Size = Total_Index_Count * 2
Total Bone Count 2 UInt16 102
Total Key Frame Count 4 UInt32 104
Material Descriptor Length 4 UInt32 108
Collision Size 4 UInt32 112
Key Frame Transformation Count 2 UInt16 116
Animation Count 2 UInt16 118
Mesh Count 2 UInt16 120
Start Frame 2 UInt16 122 Always 1
Bounding Box Minimum 12 Vector3 124
Bounding Box Maximum 12 Vector3 136
Bounding Sphere Center 12 Vector3 148
Bounding Sphere Radius 4 Float 160
[GBBone (Size: 41; Condition: IF GBHeader.Bone_Count > 0 AND GBHeader.Bone_Identifier > 0; Read: FOR 0 TO GBHeader.Bone_Count))]
Description Length Type Offset Comments
------------------------------ ------- ----------- ------- ----------------------
Transformation 64 4x4 Matrix 0
Link 1 UInt8 64 Root = 255
[GBMaterialHeader (Size: 18; Condition: IF GBHeader.Material_Count > 0; Read: FOR 0 TO GBHeader.Material_Count)]
Description Length Type Offset Comments
------------------------------ ------- ------- ------- ----------------------
Texture File Name Offset 4 UInt32 0
Texture Map Option 2 UInt16 4
Texture File Name Length 4 UInt32 6
Texture Overlay String Offset 4 UInt32 10 "Water" is the only overlay available
Material Offset 4 UInt32 14 Ambient, Diffuse, Specular, Power
[GBMeshHeader (Size: 15; Condition: IF GBHeader.Mesh_Count > 0; Read: FOR 0 TO GBHeader.Mesh_Count)]
Description Length Type Offset Comments
------------------------------ ------- ------- ------- ----------------------
Name Offset 4 UInt32 0
Material Header Index 4 UInt32 4
Vertex Type 1 UInt8 8 0 to 11 (Only 0-5 are used)
Triangle Type 1 UInt8 9 0 = List, 1 = Strip
Vertex Count 2 UInt16 10
Index Count 2 UInt16 12
Bone Count 1 UInt8 14
>>> [GBMesh]
Description Type Length
------------ ------- -----------------------------------------------------
Bones UInt8 GBMeshHeader.Bone_Count
Vertices FVF GBMeshHeader.Vertex_Count * (((GBMeshHeader.Vertex_Type % 4) * 4) + 32)
Indices UInt16 GBMeshHeader.Index_Count * 2
[GBAnimationHeader (Size: 6; Condition: IF GBHeader.Animation_Count > 0)]
Description Length Type Offset Comments
------------------------------ ------- ------- ------- ----------------------
Identifier 4 UInt32 0
Key Frame Count 2 UInt16 4
>>> [GBAnimationKeyFrame (Size: 6; Read: FOR 0 TO GBAnimationHeader.Key_Frame_Count)]
Description Length Type Offset Comments
-------------------------- ------- ------- ------- ----------------------
Duration 2 UInt16 0 Seconds
Animation Identifier 4 UInt32 2
[GBAnimationBone (Read: FOR 0 TO GBAnimationHeader.Key_Frame_Count, FOR 0 TO GBHeader.Bone_Count)]
Description Type Length
---------------------------------- ------- -----------------------------------
Key Frame Transformation Index UInt16 GBHeader.Bone_Count * 2
[GBAnimationKeyFrameTransformation (Size: 40; Read: FOR 0 TO GBHeader.Key_Frame_Transformation_Count))]
Description Length Type Offset Comments
------------------------------ ------- ---------- ------- -------------------
Translation 12 Vector3 0
Rotation 16 Quaternion 12
Scale 12 Vector3 28
The project will be open source when complete. Credits to phantom for the help so far.
P.S. I'm also planning on building in a texture-edit function, so you can easy change the filename of the textures.
And remember that you can use PNG,GIF,TGA instead of converting to GTX every time, it's not nessary
Last edited: