Difference between revisions of "Geometry Struct"

From GTAMods Wiki
Jump to navigation Jump to search
(Geometry Data)
m (Redirected page to RpGeometry)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RW Section|Struct|0x0001}}
+
#REDIRECT [[RpGeometry]]
 
 
''This article is about the [[Struct (RW Section)|Struct]] section accompanied by a [[Geometry (RW Section)|Geometry]] parent section.''
 
 
 
The '''Geometry Struct''' sections can usually be found in [[model file]]s used by the GTA III game trilogy. They are amongst the most important sections inside a <code>.dff</code> file since they contain the actual mesh data. The typical location in the file's section hierarchy is ''[[Clump (RW Section)|Clump]] > [[Geometry List (RW Section)|Geometry List]] > [[Geometry (RW Section)|Geometry]] > Struct''.
 
 
 
==Header==
 
 
 
There is a ''16 byte'' header with section content information:
 
 
 
2b - WORD  - Flags
 
1b - BYTE  - Number of of UV coordinate sets
 
1b - BYTE  - Unknown (is set to 1 in PS2 files, otherwise 0)
 
4b - DWORD - Face Count
 
4b - DWORD - Vertex Count (also normals and colors, if included)
 
4b - DWORD - Frame Count
 
 
 
;Flags:
 
Bit 0: triangle strip (else triangle list)
 
Bit 1: vertex positions are included (usually 1)
 
Bit 2: UV coordinates are included
 
Bit 3: vertex colors are included
 
Bit 4: normals are included (0 for most static map objects)
 
Bit 5: unknown (''GeometryLight'')
 
Bit 6: unknown (''GeometryModulateMaterialColor'')
 
Bit 7: multiple sets of UV coordinates are included (see header)
 
 
 
==Geometry Data==
 
 
 
12b - FLOAT[3] - Scene Lighting Info (ambient, diffuse, specular) - '''only for RW versions < 3.4!'''
 
  4b - BYTE[4]  - Vertex Colors (RGBA) - '''array''' of <nowiki>[Vertex Count]</nowiki> entries, if flag bit 3 is set
 
  8b - FLOAT[2] - UV Coords - '''array''' of <nowiki>[Vertex Count]</nowiki> entries, if flag bit 2 is set;
 
                  multiple blocks if bit 7 is set and the UV set count in the header is > 1
 
  8b - WORD[4]  - Face Indices (Vert 2, Vert 1, Flags, Vert 3) - '''array''' of <nowiki>[Face Count]</nowiki> entries
 
16b - FLOAT[4] - Bounding Sphere (X, Y, Z, Radius)
 
  8b - DWORD[2] - has position, has normals (1 if true; possibly not used)
 
12b - FLOAT[3] - Vertices (X, Y, Z) - '''array''' of <nowiki>[Vertex Count]</nowiki> entries
 
12b - FLOAT[3] - Normals (X, Y, Z) - '''array''' of <nowiki>[Vertex Count]</nowiki> entries, if flag bit 4 is set
 
 
 
'''Note:''' Face Indices are overridden if there's a [[Bin Mesh PLG (RW Section)|Bin Mesh PLG]] section. This is also used to assign different materials to parts of the mesh.
 
'''Note:''' Vertex Colors, UV Coordinates, Face Indices, Vertices, and Normals are omitted in PS2 files, and instead Native Data PLG is used for geometry information.
 
 
 
==See also==
 
 
 
* [http://www.chronetal.co.uk/gta/index.php?page=dff Original DFF format description] by KCow
 

Latest revision as of 05:27, 14 June 2016

Redirect to: