Graphic Tools GuideFormat list

SEGA 3D file specifications

As of August 08, 1995

■ Data structure / file layout


■ Header

"
    SEGA 3D
"

◆ Purpose
File type identification.

◆ Terms
Must be at the beginning of the file.

■ Model

There is one pair of vertex structures (vertices) and polygons (polygons) in one model.
Mixing of the same model name is not allowed.
"
    model modelname
    {
        vertices; number of verticies
        {    
            (x0, y0, z0), (nx0, ny0, nz0); 0
            (x1, y1, z1), (nx1, ny1, nz1); 1
            .............; 2
        }
        polygons; number of polygons
        {
            (v0, v1, v2, v3), (Nx, Ny, Nz), (Zpos); 0
            .............; 1
        }
    }
"

◆ Purpose
Set the vertices and polygon structure of the 4-point polygon model.

◆ Reserved words
 model
 : Control structure
 vertices
 : Control structure
 polygons
 : Control structure

◆ Data
 modelname
 : Model name
 (Xn, Yn, Zn)
 : Coordinates of each vertex
 (nx0, ny0, nz0)
 : Each vertex normal vector (unit vector)
 (v0, v1, v2, v3)
 : Vertex numbers that make up the face
 (Nx, Ny, Nz)
 : Surface normal vector
 (Zpos)
 : Z sort criteria (AVE = center / MIN = recent / MAX = farthest)

◆ Terms
The order of the vertices that make up the face is "clockwise".
0 1
┌───────┐ 
│ → │ 
│ │ 
│ ↑ ↓ │ 
│ │ 
│ ← │ 
└───────┘ 
3 2
When expressing a triangle, v2 and v3 have the same number.

■ Slip

Data structure for Saturn old tool compatibility.
If there is any material data in the model, a slip is constructed.
"
    slips modelname
    {
        materialname_0
        materialname_1
        .........
    }
"

◆ Purpose
Correspond the surface structure of each model with the material.

◆ Reserved words
 slips
 : Control structure

◆ Data
 modelname
 : Corresponding model name
 materialname_n
 : Corresponding material name

◆ Terms
Each material name corresponds to the surface number included in the corresponding model.

■ Material

Data structure for Saturn old tool compatibility.
Each data is configured as needed.
"
    material material name
    {
        type (TYPE0 | TYPE1 | ...)
        texture "textureName"
        color ColorCode
        gouraud offset
        direction 0,1,2,3
    }
"

◆ Purpose
Set the surface attributes to be assigned to each surface.

◆ Reserved words
 material
 : Control structure
 type
 : Reserved word
 texture
 : Reserved word
 color
 : Reserved word
 gouraud
 : Reserved word
 direction
 : Reserved word

◆ Data
 materialname
 : Material name
 (TYPEn)
 : Material type. Specify a method such as shading mapping.
 → NULL = None
 FLAT = flat shading
 TEXT = texture mapping
 GOUR = Gouraud shading
 MESH = mesh display
 TRAN = translucent
 SHAD = half brightness
 * For multiple specifications, connect with'|'.
 "textureName"
 : Texture map file name
 ColorCode
 : Non-texture color code (RGB 5bit = 1b.B5.G5.R5)
 offset
 : Goo color offset = 0x10. Unused data.
 0,1,2,3
 : Correspondence to each vertex of the texture map. Display direction.
→ [0,1,2,3] = Normal display
[1,0,3,2] = H inverted display
[3,2,1,0] = V inverted display
[2,3,0,1] = HV inverted display
[1,2,3,0] = 90 degree rotation Normal display
[2,1,0,3] = 90 degree rotation H inverted display
[0,3,2,1] = 90 degree rotation V inverted display
[3,0,1,2] = 90 degree rotation HV inverted display

■ Object

When multiple models exist, the object structure is constructed.
"
    object objectname
    {
        modelname_0, (xs, ys, zs), (xd, yd, zd), (xt, yt, zt), (xi, yi, zi)
        {
        }
        modelname_1, (xs, ys, zs), (xd, yd, zd), (xt, yt, zt), (xi, yi, zi)
        {
            modelname_2, (xs, ys, zs), (xd, yd, zd), (xt, yt, zt), (xi, yi, zi)
            {
                modelname_4, (xs, ys, zs), (xd, yd, zd), (xt, yt, zt), (xi, yi, zi)
                {
                }
            }
            modelname_3, (xs, ys, zs), (xd, yd, zd), (xt, yt, zt), (xi, yi, zi)
            {
            }
        }
        ..................................
        ..................................
    }
"

◆ Purpose
Set the hierarchical matrix structure of each model.

◆ Reserved words
 object
 : Control structure

◆ Data
 objectname
 : Object name (= file name)
 modelname_n
 : Model name
 (xs, ys, zs)
 : Scale (ratio)
 (xd, yd, zd)
 : Rotate (angle: -180.0 ~ + 179.0)
 (xt, yt, zt)
 : Translation (coordinates)
 (xi, yi, zi)
 : Currently unused = (0,0,0) 

■ Light source
"
    light
    {
        vector n; number of light
        {
            (X0, Y0, Z0); 0
            (X1, Y1, Z1); 1
            ............
        }
    }
"

◆ Purpose
Set the light source vector.

◆ Reserved words
 light
 : Control structure
 vector
 : Control structure

◆ Data
 (Xn, Yn, Zn)
 : Light source unit vector 

■ Attributes

Attributes are target-dependent data structures.
"
    attribute modelname
    {
        {
            type (TYPE0 | TYPE1 | ...)
            texture "textureName"
            color ColorCode1, ColorCode2
            gour_color (R1, G1, B1), (R2, G2, B2), (R3, G3, B3), (R4, G4, B4)
            direction 0,1,2,3
            zsort (Zpos)
        }
        {
            .....
        }
        ..........
        ..........
    }
"

◆ Purpose
Set the attributes to be assigned to each face of the model.

◆ Reserved words
 attribute attribute
 : Control structure
 type
 : Reserved word
 texture
 : Reserved word
 color
 : Reserved word
 gour_color
 : Reserved word
 direction
 : Reserved word

◆ Data
 modelname
 : Model name
 (TYPEn)
 : Material type (similar to material data).
 Specify a method such as shading mapping.
 → NULL = None
 FLAT = flat shading
 TEXT = texture mapping
 GOUR = Gouraud shading
 MESH = mesh display
 TRAN = translucent
 SHAD = half brightness
 * For multiple specifications, connect with'|'.
 "textureName"
 : Texture map file name
 ColorCode1
 : Non-texture color code set for the material
 (RGB each 5bit = 1b.B5.G5.R5)
 ColorCode2
 : Non-texture color code calculated by the current light source
 (RGB each 5bit = 1b.B5.G5.R5)
 (Rn, Gn, Bn)
 : 4-vertex goo-low table calculated by the current light source
 0,1,2,3
 : Correspondence to each vertex of the texture map. Display direction.
 → [0,1,2,3] = Normal display
 [1,0,3,2] = H inverted display
 [3,2,1,0] = V inverted display
 [2,3,0,1] = HV inverted display
 [1,2,3,0] = 90 degree rotation Normal display
 [2,1,0,3] = 90 degree rotation H inverted display
 [0,3,2,1] = 90 degree rotation V inverted display
 [3,0,1,2] = 90 degree rotation HV inverted display
 (Zpos)
 : Z sort criteria (AVE = center / MIN = recent / MAX = farthest

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