Japanese
Graphic Tools GuideFormat list

SG3D file format

1996-07-12

■File layout

 [header]
Required
 [Object](1)
Required
 [Vertex]
Required
 [Normal]
Required
 [polygon]
Required
 [Model name]
expansion
 ......
 [Object](2)
 [Vertex]
 [Normal]
 [polygon]
 ......
 [object]...
 .............

■IFF format

(1) Little endian (Intel format)

(2) Tag
typedef char CHAR;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef float FLOAT;
struct tag_IFF{
CHAR chunk[4]; //4 character chunk name
DWORD size; //data size
};

(3)Layout
[tag]
[data]
[tag]
[data]
......
......

■Format

(1) Standard tags → All required

[header]
Contents: File identification information
Chunk: "SG3D"
Size: 256
Data: Type Contents
     DWORD version (0x00011000)
     DWORD number of objects
     DWORD[62] Reservation

[object]
Contents: Hierarchy information
Chunk: "OBJT"
Size: 96
Data: Type Contents
     FLOAT[4][3] 3x4 transformation matrix
     FLOAT[3] Translation (XYZ)
     FLOAT[3] Rotation (XYZ)
     FLOAT[3] Scaling (XYZ)
     DWORD ID(0~n)
     DWORD Child ID
     DWORD Sibling ID

Note: The unit of angle is (degrees)
      ID is -1 (0xffffffff) if there are no children or siblings

[vertex]
Contents: Vertex coordinates
Chunk: "VerF"
Size: 12x number of vertices
Data: Type Contents
      FLOAT[3] Vertex coordinates (XYZ)

Note: Set the above data for the number of vertices.

[Normal]
Contents: Vertex normal vector
Chunk: "NorF"
Size: 12x number of vertices
Data: Type Contents
     FLOAT[3] Vertex normal vector (XYZ)

Note: Unit vector that sets the above data for the number of vertices

[polygon]
Contents: Polygon vertex number
Chunk: "POLY"
Size: 8x number of polygons
Data: Type Contents
     WORD[4] Vertex numbers that make up the 4-point polygon

Note: Set the above data for the number of polygons.
     Vertex number is clockwise

(2) Extended tag → can be omitted

[Model name]
Contents: Object (layer) name
Chunk: "MoNm"
Size: string length
Data: Type Contents
     CHAR[?] Object name string

Note: The string must include the exit code ('\0')

[Gouro table]
Contents: Gouro table for Sega Saturn
Chunk: "SSGr"
Size: 8x number of polygons
Data: Type Contents
     WORD[4] Gouraud data with polygon applied

Note: Set the above data for the number of polygons.
Default is {0xc210,0xc210,0xc210,0xc210}
Details separately

[attribute]

Contents: Surface attributes for Sega Saturn
Chunk: "SSAt"
Size: 12x number of polygons
Data: Type Contents
      WORD Front and back flip flag
      0 Single_Plane
      1 Dual_Plane
      
      WORD Z sort flag
      0 SORT_CEN (center point)
      1 SORT_MIN (nearest point)
      2 SORT_MAX (refar point)
      3 SORT_FAR (unused)
      4 SORT_NER (unused)
      
      WORD Texture number WORD Color (R:G:B=5:5:5)
      
      DWORD Surface attribute type BIT
      0 texHflip
      1 texVflip
      2
      3 sprTexture
      4 sprPolygon
      5 sprPolyLine
      6
      7 User Shade
      8 MESHon
      9 CL_Shadow
      10 CL_Half
      11 CL_Trans
      12 CL_Gouraud
      13 ECdis
      14 SPdis
      15 CL16Bnk
      16 CL16Look
      17 CL64Bnk
      18 CL128Bnk
      19 CL256Bnk
      20 CL32KRGB
      21 Window_In
      22 Window_Out
      23
      24 UseLight
      25 UseClip
      26 UsePalette
      27 UseNearClip
      28 UseDepth
      29
      30
      31

Note: The default setting of the above data for the number of polygons is {0,0,0,0xc210,0x01100010}
      Details separately

Graphic Tools GuideFormat list
Copyright SEGA ENTERPRISES, LTD. 1997