------------------------------------------------------------------------------
                     MY3D File Format ver.3
------------------------------------------------------------------------------

MY_ID                            4 bytes  int          My3D Format Id
MY_VER                           2 bytes  short int    My3D Format Version

MY_SCENE_HEADER_ID               2 bytes  short int    Scene Header Id 

  BackgrColor_Red                4 bytes  int          background color Red
  BackgrColor_Green              4 bytes  int          background color Green
  BackgrColor_Blue               4 bytes  int          background color Blue
  BackgrColor_Alpha              4 bytes  int          background color Alpha
  AmbientColor_Red               4 bytes  int          ambient color Red
  AmbientColor_Green             4 bytes  int          ambient color Green
  AmbientColor_Blue              4 bytes  int          ambient color Blue
  AmbientColor_Alpha             4 bytes  int          ambient color Alpha   
  MaterialCount                  4 bytes  int          material count
  MeshCount                      4 bytes  int          mesh count

MY_MAT_LIST_ID                   2 bytes  short int    Material List Id  
  
  ---- Material[0] -------------------------------------------------------------
  |                                                                            |
  |MY_MAT_HEADER_ID               2 bytes  short int    Material Header Id     |
  |                                                                            |
  |  Name                         256 b.   char[256]    material name          |
  |  Index                        4 bytes  unsigned int material index         |
  |  AmbientColor_Red             4 bytes  int          Ambient color Red      |
  |  AmbientColor_Green           4 bytes  int          Ambient color Green    |
  |  AmbientColor_Blue            4 bytes  int          Ambient color Blue     |
  |  AmbientColor_Alpha           4 bytes  int          Ambient color Alpha    |
  |  DiffuseColor_Red             4 bytes  int          Diffuse color Red      |
  |  DiffuseColor_Green           4 bytes  int          Diffuse color Green    |
  |  DiffuseColor_Blue            4 bytes  int          Diffuse color Blue     |
  |  DiffuseColor_Alpha           4 bytes  int          Diffuse color Alpha    |
  |  EmissiveColor_Red            4 bytes  int          Emissive color Red     |
  |  EmissiveColor_Green          4 bytes  int          Emissive color Green   |
  |  EmissiveColor_Blue           4 bytes  int          Emissive color Blue    |
  |  EmissiveColor_Alpha          4 bytes  int          Emissive color Alpha   |
  |  SpecularColor_Red            4 bytes  int          Specular color Red     |
  |  SpecularColor_Green          4 bytes  int          Specular color Green   |
  |  SpecularColor_Blue           4 bytes  int          Specular color Blue    |
  |  SpecularColor_Alpha          4 bytes  int          Specular color Alpha   |
  |  Shininess                    4 bytes  float                               |
  |  Trasparency                  4 bytes  float        0-min, 1-max           |
  |  TextureCount                 4 bytes  int                                 |
  |                                                                            |
  |  ----- Texture[0] -------------------------------------------------------  |
  |  |                                                                      |  |
  |  |One of this cases:                                                    |  |
  |  |                                                                      |  |
  |  |1) Texture as standalone file                                         |  |
  |  |                                                                      |  |
  |  |MY_TEX_FNAME_ID          2 bytes  short int     Texture File Name Id  |  |
  |  |                                                                      |  |
  |  |  Tex_File_Name          256 b.   char[256]     Texture file name     |  |
  |  |                                                                      |  |
  |  |2) Textures as embedded image data (Lightmaps for example)            |  |
  |  |                                                                      |  |
  |  |MY_TEXDATA_ID            2 bytes  short int     Texture Data Id       |  |
  |  |                                                                      |  |
  |  |  MY_TEXDATA_HEADER_ID   2 bytes  short int     Texture Data Header Id|  |
  |  |                                                                      |  |
  |  |    Name                 256 b.   char[256]     texture name          |  |
  |  |    ComprMode            4 bytes  unsigned int  compression mode      |  |
  |  |    PixelFormat          4 bytes  unsigned int  pixel format          |  |
  |  |    Width                4 bytes  unsigned int  image width           |  |
  |  |    Height               4 bytes  unsigned int  image height          |  |
  |  |                                                                      |  |
  |  |  One of this cases:                                                  |  |
  |  |                                                                      |  |
  |  |  2.1) PixelFormat = '_16_' (16 bit)                                  |  |
  |  |                                                                      |  |
  |  |    One of this cases:                                                |  |
  |  |                                                                      |  |
  |  |    2.1.1) ComprMode = 'NONE'                                         |  |
  |  |                                                                      |  |
  |  |      non_compressed_16_bit_image_data                                |  |
  |  |                                                                      |  |
  |  |    2.1.2) ComprMode = 'SIMP'                                         |  |
  |  |                                                                      |  |
  |  |      simple_compressed_16_bit_image_data                             |  |
  |  |                                                                      |  |
  |  |    2.1.3) ComprMode = ' RLE'                                         |  |
  |  |                                                                      |  |
  |  |     rle_compressed_16_bit_image_data                                 |  |
  |  |                                                                      |  |
  |  |  2.2) PixelFormat = '_24_' (24 bit)                                  |  |
  |  |                                                                      |  |
  |  |    One of this cases:                                                |  |
  |  |                                                                      |  |
  |  |    2.2.1) ComprMode = 'NONE'                                         |  |
  |  |                                                                      |  |
  |  |      non_compressed_24_bit_image_data                                |  |
  |  |                                                                      |  |
  |  |    2.2.2) ComprMode = 'SIMP'                                         |  |
  |  |                                                                      |  |
  |  |      simple_compressed_24_bit_image_data                             |  |
  |  |                                                                      |  |
  |  |    2.2.3) ComprMode = ' RLE'                                         |  |
  |  |                                                                      |  |
  |  |      rle_compressed_24_bit_image_data                                |  |
  |  |                                                                      |  |    
  |  ------------------------------------------------------------------------  |
  |                                                                            |
  |  ...                                                                       |
  |                                                                            |
  |  ----- Texture[TextureCount-1] ------------------------------------------  |  
  |  |                                                                      |  |
  |  | ...                     ...       ...         ...                    |  |  
  |  |                                                                      |  |    
  |  ------------------------------------------------------------------------  |
  |                                                                            |
  ------------------------------------------------------------------------------

  ...

  ---- Material[MaterialCount-1] -----------------------------------------------
  |                                                                            |
  |MY_MAT_HEADER_ID                                                            |
  |                                                                            |
  | ...                       ...        ...          ...                      |
  |                                                                            |
  ------------------------------------------------------------------------------

MY_MESH_LIST_ID            2 bytes  short int          Mesh List Id 

  --- Mesh[0]-------------------------------------------------------------------
  |                                                                            |
  |MY_MESH_HEADER_ID    2 bytes  short int        Mesh Header Id               |
  |                                                                            |
  |  Name               256 b.   char[256]        Material Name                |
  |  MatIndex           4 bytes  unsigned int     Index Of The Mesh Material   |
  |  TChannelCnt;       4 bytes  unsigned int     Mesh Mapping Channels Count  |
  |                                                                            |
  |  MY_VERTS_ID        2 bytes  short int        Mesh Vertices List Id        |
  |                                                                            |
  |    VertexCount      4 bytes  int              Mesh Vertices Count          |
  |                                                                            |
  |    ----Vertex[0]---------------------------------------------------------  |
  |    |                                                                    |  |
  |    |  Coord_X           4 bytes  float              Vertex X-coordinate |  |
  |    |  Coord_Y           4 bytes  float              Vertex Y-coordinate |  |
  |    |  Coord_Z           4 bytes  float              Vertex Z-coordinate |  |
  |    |                                                                    |  |
  |    |  Color_R           4 bytes  int                Color R-value       |  |
  |    |  Color_G           4 bytes  int                Color G-value       |  |
  |    |  Color_B           4 bytes  int                Color B-value       |  |
  |    |  Color_A           4 bytes  int                Color A-value       |  |
  |    |                                                                    |  |
  |    |  Normal_X          4 bytes  float              Normal X-coordinate |  |
  |    |  Normal_Y          4 bytes  float              Normal Y-coordinate |  |
  |    |  Normal_Z          4 bytes  float              Normal Z-coordinate |  |
  |    |                                                                    |  |
  |    ----------------------------------------------------------------------  |
  |                                                                            |
  |    ...                                                                     |
  |                                                                            |
  |    ----Vertex[VertexCount-1]---------------------------------------------  |
  |    |                                                                    |  |
  |    |  ...                ...      ...               ...                 |  |
  |    |                                                                    |  |
  |    ----------------------------------------------------------------------  |
  |                                                                            |
  |  MY_FACES_ID            2 bytes  short int        Mesh Faces List Id       |
  |                                                                            |
  |	  FacesCount           4 bytes  int              Mesh Faces Count      |
  |                                                                            |
  |    ----Face[0]-----------------------------------------------------------  |
  |    |                                                                    |  |	  
  |    |  Index_A           4 bytes  unsigned int     Vertex A-index        |  |
  |    |  Index_B           4 bytes  unsigned int     Vertex B-index        |  |
  |    |  Index_C           4 bytes  unsigned int     Vertex C-index        |  |
  |    |                                                                    |  |
  |    ----------------------------------------------------------------------  |
  |                                                                            |
  |    ...                                                                     |
  |                                                                            |
  |    ----Face[FacesCount-1]------------------------------------------------  |
  |    |                                                                    |  |
  |    |  ...                ...       ...              ...                 |  |
  |    |                                                                    |  |
  |    ----------------------------------------------------------------------  |
  |                                                                            |
  |  -- texture channel [0] -------------------------------------------------  |
  |  |                                                                      |  |
  |  |MY_TVERTS_ID                2 bytes  short int                        |  |
  |  |                                                                      |  |
  |  |  TVertexCount                                                        |  |
  |  |                                                                      |  |
  |  |  ----- TVertex[0] -------------------------------------------------  |  |
  |  |  |                                                                |  |  | 
  |  |  |  TCoord_X       4 bytes  float          Texture U-coordinate   |  |  |
  |  |  |  TCoord_Y       4 bytes  float          Texture V-coordinate   |  |  |
  |  |  |                                                                |  |  |
  |  |  ------------------------------------------------------------------  |  |
  |  |                                                                      |  |
  |  |  ...                                                                 |  |
  |  |                                                                      |  |       
  |  |                                                                      |  |
  |  |  ----- TVertex[TVertexCount-1] ------------------------------------  |  |
  |  |  |                                                                |  |  |
  |  |  |  ...              ...        ...            ...                |  |  |
  |  |  |                                                                |  |  |
  |  |  ------------------------------------------------------------------  |  |
  |  |                                                                      |  |
  |  |MY_TFACES_ID                2 bytes  short int                        |  |
  |  |                                                                      |  |
  |  |  TFacesCount                                                         |  |   
  |  |                                                                      |  |  
  |  |  ----- TFace[0] ---------------------------------------------------  |  |
  |  |  |                                                                |  |  | 
  |  |  |  TIndex_A     4 bytes  unsigned int    Textured Vertex A-index |  |  |
  |  |  |  TIndex_B     4 bytes  unsigned int    Textured Vertex B-index |  |  |
  |  |  |  TIndex_C     4 bytes  unsigned int    Textured Vertex C-index |  |  |
  |  |  |                                                                |  |  | 
  |  |  ------------------------------------------------------------------  |  |
  |  |                                                                      |  |
  |  |  ...                                                                 |  |
  |  |	                                                                    |  |
  |  |  ----- TFace[TFacesCount-1] ---------------------------------------  |  |
  |  |  |                                                                |  |  |
  |  |  | ...              ...     ...               ...                 |  |  |
  |  |	|                                                                |  |  |
  |  |  ------------------------------------------------------------------  |  |
  |  |	                                                                    |  |     
  |  ------------------------------------------------------------------------  |
  |                                                                            |
  |  ...                                                                       |
  |                                                                            |
  |  -- texture channel [TChannelCnt-1] -------------------------------------  |
  |  |                                                                      |  |
  |  |  ...                ...       ...              ...                   |  |
  |  |                                                                      |  |
  |  ------------------------------------------------------------------------  |
  |                                                                            |
  ------------------------------------------------------------------------------

  ...

  --- Mesh[MeshCount-1]---------------------------------------------------------
  |                                                                            |
  |  ...                   ...      ...               ...                      |
  |                                                                            |                                                                              
  ------------------------------------------------------------------------------

MY_FILE_END_ID                  2 bytes  short int        End Of My3D File Id