Graphic Tools GuideFormat list

SG3D file format

1996-07-12

■ File layout

 [header]
Mandatory
 [Object] (1)
Mandatory
 [Top point]
Mandatory
 [Normal]
Mandatory
 [polygon]
Mandatory
 [Model name]
Expansion
 ........
 [Object] (2)
 [Top point]
 [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]; // Character chunk name DWORD size; // Data size};

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

■ Format

(1) Standard tag → All required

[header]
Contents: File identification information chunk: "SG3D"
Size: 256
Data: Type Description DWORD Version (0x00011000)
Number of DWORD objects DWORD [62] Reserved

[object]
Contents: Hierarchical information chunk: "OBJT"
Size: 96
Data: Type Description FLOAT [4] [3] 3x4 conversion matrix FLOAT [3] Translation (XYZ)
FLOAT [3] Rotation (XYZ)
FLOAT [3] Scaling (XYZ)
DWORD ID (0 to n)
DWORD Child ID
DWORD Brother ID

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

[vertex]
Contents: Vertex coordinate chunk: "VerF"
Size: 12x Number of vertices Data: Type Description FLOAT [3] Coordinates of vertices (XYZ)

Remarks: Set the above data for the number of vertices

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

Remarks: Set the above data for the number of vertices Unit vector

[polygon]
Contents: Polygon vertex number chunk: "POLY"
Size: 8x Number of polygons Data: Type Description WORD [4] Vertex numbers that make up a 4-point polygon Remarks: Set the above data for the number of polygons Vertex numbers are clockwise

(2) Extension tag → It is not necessary

[Model name]
Contents: Object (hierarchy) name chunk: "MoNm"
Size: String Length Data: Type Description CHAR [?] String of object name Remarks: The string must include the end code ('\ 0')

[Goolow table]
Contents: Sega Saturn Goo Table Chunk: "SSGr"
Size: 8x number of polygons Data: Type Description WORD [4] Gouraud data with polygons applied Remarks: Set the above data for the number of polygons The default is {0xc210,0xc210,0xc210,0xc210}
Details separately

[attribute]
Contents: Sega Saturn surface attribute chunk: "SSAt"
Size: 12x Number of polygons Data: Type Description WORD Front and back inversion flag 0 Single_Plane
1 Dual_Plane

WORD Z sort flag 0 SORT_CEN (center point)
1 SORT_MIN (recent points)
2 SORT_MAX (re-distant point)
3 SORT_FAR (unused)
4 SORT_NER (unused)

WORD Texture Number WORD Color (R: G: B = 5: 5: 5)

DWORD Face attribute type BIT
0 texHflip
1 texVflip
2
3 sprTexture
4 sprPolygon
5 sprPolyLine
6
7 UserShade
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
    twenty three
24 UseLight
25 UseClip
26 Use Palette
27 UseNearClip
28 UseDepth
29
30
31

Remarks: Set the above data for the number of polygons. The default is {0,0,0,0xc210,0x01100010}
Details separately

Graphic Tools GuideFormat list
Copyright SEGA ENTERPRISES, LTD ,. 1997