Code: Select all
Genesis3D 3DT File Format, version 1.32:
This spec was produced by examining the code of GEdit and Genesis3D engine,
and a sample 3DT file output by GEdit.
Each line is of format: KeyName Values
Example: Vec3d -1296.000000 -415.999756 967.999756
But some have multiple KeyNames in a single line
Example: TexInfo Rotate 0 Shift 0 0 Scale 1.000000 1.000000 Name "bkrock"
Lines tend to have various whitespace at the beginning.
All parentheses here are annotation, not in the actual format.
Brackets indicate substitutions.
Tokens are separated by whitespace.
N = decimal integer
F = float
S = string
X = hex integer
B = boolean (zero or nonzero)
[Header]
[Brushlist]
[Entities]
[Models]
[Groups]
[Sky]
[Settings]
///////////////////////////////////////////////////////////
Header:
3dtVersion N.N (major.minor)
TextureLib S (filename)
NumEntities N
NumModels N
NumGroups N
///////////////////////////////////////////////////////////
Brushlist:
Brushlist N (number of brushes)
[N Brush entries]
Brush:
Brush S (texture name or brush name)
Flags N (bitflags integer, in decimal form)
ModelId N
GroupId N
HullSize F
Type N (enum for brush type, 1 = multi, 2 = leaf, 4 = csg)
[either [Brushlist] if Type was multi, or [Facelist] if Type was leaf]
Facelist:
BrushFaces N (number of faces)
[N Face entries]
Face:
NumPoints N
Flags N (another bitfield in decimal form)
Light N
MipMapBias F
Translucency F
Reflectivity F
[N (from NumPoints) Vec3d entries]
TexInfo Rotate N Shift N N Scale F F Name S
(rotation in degrees, value pairs are X,Y or U,V)
LightScale F F (X,Y)
[Transform]
Pos F F F (X,Y,Z)
Vec3d:
Vec3d F F F (X,Y,Z)
Transform:
Transform F F F F F F F F F F F F
(that's 12 F's, making AX AY AZ BX BY BZ CX CY CZ TX TY TZ)
///////////////////////////////////////////////////////////
Entities:
Class CEntList
EntCount N
CurEnt N
[N (from EntCount) Entity entries]
Entity:
CEntity
eStyle N (0 = point entity, 1 = brush entity)
eOrigin F F F N (X,Y,Z,trash)
eFlags N
eGroup N
ePairCount N
[N Key entries]
End CEntity
Key:
Key S Value S (first S is key name, second S is full value in text form)
(example: Key Origin Value "128 -1272 804")
///////////////////////////////////////////////////////////
Models:
[N (from header NumModels) Model entries]
Model:
Model S (name of model)
ModelId N
CurrentKeyTime F
[Transform]
Motion B
[Motion]
Motion:
MOTN X.X (should be 0.F0)
NameID
MaintainNames B
PathCount N
NameChecksum N
Events B
[if N != 0, Events entry]
NameArray B
[if N != 0, StrBlock entry]
PathArray B
[N Path entries]
Events: (this wasn't in the sample file, so it might be wrong)
TKEV X.X (0.F0 again)
DataSize N
TimeKeys N
[N copies of the next 2 lines]
F N (Time, ?)
S (some event string)
StrBlock:
SBLK X.X (0.F0 again)
Strings N
[N lines of string data]
Path:
PATH X.X (0.F2, earlier versions are different)
Rotation N N (flag, interpolation type)
[if flag != 0, QKFrame entry]
Translation N N (flag, interpolation type)
[if flag != 0, VKFrame entry]
QKFrame:
Keys N N N B (NumElements, InterpolationType, Compression, Looping)
(enum QK_InterpolationType: LINEAR = 0, SLERP = 1, SQUAD = 2)
[if Compression != 0, compression info here]
[N (NumElements) QKFrameElement entries]
QKFrameElement: (this is different if Compression != 0)
F F F F F (time, W, X, Y, Z)
VKFrame:
Keys N N N B (just like QKFrame)
(enum VK_InterpolationType: LINEAR = 0, HERMITE = 1, HERMITE_ZERO_DERIV = 2)
[if Compression != 0, compression info here]
[N (NumElements) VKFrameElement entries]
VKFrameElement: (this is different if Compression != 0)
F F F F (time, X, Y, Z)
///////////////////////////////////////////////////////////
Groups:
[N (from header NumGroups) Group entries]
Group:
Group S (name)
GroupId N
Visible B
Locked B
Color F F F (R, G, B)
///////////////////////////////////////////////////////////
Sky:
Sky
[6 times of the following 1 line]
B S (Apply, texname)
Axis F F F (normalized rotation axis)
Speed F (rotation speed)
Scale F (texture scale)
///////////////////////////////////////////////////////////
Settings: (this is mostly useless outside of GEdit)
[CompileInfo]
ShowGroups B
[ViewSettings]
[GridInfo]
BspRebuild N
[ViewInfo]
[BrushTemplates]
TemplatePos F F F (X,Y,Z)
DrawScale F
LightmapScale FAnd some .3dt files: http://www.comunidad-e3d.com/descargas/ ... jetsWK.zip
Thanks for your answers!