Japanese
Graphic Tools GuideFormat list

SEGA3D file specifications

As of 1995.08.08

■Data structure/file layout


■Header

"
    SEGA 3D
”

◆Purpose
File type identification.

◆Terms
Must exist at the beginning of the file.

■Model

There is one pair of vertex structures (vertices) and surface structures (polygons) in one model.
Mixing of the same model name is not allowed.
"
    model model name
    {
        vertices ;number of vertices
        {    
            (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
 model name
 : Model name
 (Xn,Yn,Zn)
 : Each vertex coordinate
 (nx0,ny0,nz0)
 : Each vertex normal vector (unit vector)
 (v0,v1,v2,v3)
 : Vertex numbers that make up the surface
 (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 surface is "clockwise."
0         1
 ┌───────┐ 
 │   →   │ 
 │       │ 
 │↑     ↓│ 
 │       │ 
 │   ←   │ 
 └───────┘ 
3         2
When representing a triangle, v2 and v3 should be the same number.

■Slip

Data structure for compatibility with old Saturn tools.
A slip is configured if any material data is present in the model.
"
    slips model name
    {
        materialname_0
        materialname_1
        ......
    }
”

◆Purpose
Match the material to the surface structure of each model.

◆Reserved words
 slips
 : Control structure

◆Data
 model name
 : Compatible model name
 materialname_n
 : Compatible material name

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

■Material

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

◆Purpose
Set the surface attributes 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 methods such as shading mapping.
 → NULL=none
 FLAT=Flat shading
 TEXT=Texture mapping
 GOUR=Goureau shading
 MESH=Mesh display
 TRAN=translucent
 SHAD=half brightness
 *For multiple specifications, connect them with '|'.
 "textureName"
 : Texture map file name
 ColorCode
 : Non-texture color code (RGB each 5bit=1b.B5.G5.R5)
 offset
 : Gouraud 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 reverse display
[3,2,1,0]=V reverse display
[2,3,0,1]=HV reverse display
[1,2,3,0]=90 degree rotation normal display
[2,1,0,3]=90 degree rotation H reverse display
[0,3,2,1]=90 degree rotation V reverse display
[3,0,1,2]=90 degree rotation HV reverse display

■Object

If multiple models exist, an 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 for 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)
 : Unit vector of light source 

■Attribute

Attributes are target-dependent data structures.
"
    attribute model name
    {
        {
            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 attributes to be assigned to each face of the model.

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

◆Data
 model name
 : Model name
 (TYPEn)
 : Material type (same as material data).
 Specify methods such as shading mapping.
 → NULL=none
 FLAT=Flat shading
 TEXT=Texture mapping
 GOUR=Goureau shading
 MESH=Mesh display
 TRAN=translucent
 SHAD=half brightness
 *For multiple specifications, connect them with '|'.
 "textureName"
 : Texture map file name
 ColorCode1
 : Non-texture color code set to material
 (RGB each 5bit=1b.B5.G5.R5)
 ColorCode2
 : Non-textured color code calculated by the current light source
 (RGB each 5bit=1b.B5.G5.R5)
 (Rn,Gn,Bn)
 : 4-vertex Gouraud 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 reverse display
 [3,2,1,0]=V reverse display
 [2,3,0,1]=HV reverse display
 [1,2,3,0]=90 degree rotation normal display
 [2,1,0,3]=90 degree rotation H reverse display
 [0,3,2,1]=90 degree rotation V reverse display
 [3,0,1,2]=90 degree rotation HV reverse display
 (Zpos)
 : Z sort criteria (AVE=Center/MIN=Recent/MAX=Farthest

Graphic Tools GuideFormat list
Copyright SEGA ENTERPRISES, LTD. 1997