Japanese
PROGRAMMER'S GUIDEMathematics calculation library
BackForward
Math calculation library

2.1 Data structure


 one
View
table
 Title
data specifications
 Data
2D point data
 Data Name
MthXy
 No
1

typedef struct MthXy {
     Fixed32 x; /* X coordinate */
     Fixed32 y; /* Y coordinate */
} MthXy; 


 one
View
table
 Title
data specifications
 Data
3D point data
 Data Name
MthXyz
 No
2

typedef struct MthXyz {
     Fixed32 x; /* X coordinate */
     Fixed32 y; /* Y coordinate */
     Fixed32 z; /* Z coordinate */
} MthXyz; 


 one
View
table
 Title
data specifications
 Data
3 rows and 4 columns matrix data
 Data Name
MthMatrix
 No
3

Typedef struct MthMatrix{
     Fixed32 val[3][4]; /* 3 rows and 4 columns fixed point data */
}MthMatrix 


 one
View
table
 Title
data specifications
 Data
matrix stack table
 Data Name
MthMatrixTbl
 No
4

typedef struct MthMatrixTbl {
     Uint16 stackSize; /* Number of entries in matrix stack */
     MthMatrix *current; /* Pointer to current matrix */
     MthMatrix *stack; /* Matrix stack pointer */
} MthMatrixTbl; 


 one
View
table
 Title
data specifications
 Data
Polygon data string coordinate conversion parameters
 Data Name
MthPolyTransParm
 No
5

 typedef struct MthPolyTransParm {
     MthViewLight *viewLight; /* Coordinate system transformation parameter */
     Uint32 surfCount; /* Number of polygon faces */
     MthXyz *surfPoint; /* Representative point of polygon surface for surface brightness calculation */
     MthXyz *surfNormal; /* Normal of polygon surface */
     Sint32 *surfBright; /* Brightness calculation result of polygon surface */
     Uint32 transViewVertCount; /* Number of vertex entries for viewpoint coordinate transformation */
     MthXyz *transViewVertSrc; /* Vertex data before viewpoint coordinate conversion */
     MthXyz *transViewVertAns; /* Vertex data after viewpoint coordinate transformation */
     Uint32 gourVertCount; /* Number of vertex entries for vertex brightness calculation */
     MthXyz *vertNormal; /* Vertex normal for vertex brightness calculation */
     Sint32 *vertBright; /* Vertex brightness calculation result */
     Uint32 transWorldVertCount;/* Number of vertex entries for world coordinate transformation */
     MthXyz *transWorldVertSrc; /* Vertex data before world coordinate transformation */
     MthXyz *transWorldVertAns; /* Vertex data after world coordinate transformation */
} MthPolyTransParm; 


 one
View
table
 Title
data specifications
 Data
Coordinate system transformation parameters
 Data Name
MthViewLight
 No
6

 typedef struct MthViewLight {
     MthMatrix viewMatrix; /* Transformation matrix to viewpoint coordinate system */
     MthXyz lightVector; /* Light source vector in the viewpoint coordinate system */
     MthMatrix worldMatrix; /* Transformation matrix to world coordinate system */
} MthViewLight;


BackForward
PROGRAMMER'S GUIDEMathematics calculation library
Copyright SEGA ENTERPRISES, LTD., 1997