1 - scene section: it can be present only once at the start of the file

Header            : TopModel 3DFile
version           : 2.00
setup view        : View1 Xviewpoint(*2^17),Yviewpoint(*2^17),Zviewpoint(*2^17),zoom(*2^17),observer dist.(*2^17), angleX(*16), angleY(*16), angleZ(*16), 15, 0|1 (perspective on/off), background colour (&BBGGRR00),ViewVectorX(*2^17),ViewVectorY(*2^17),ViewVectorZ(*2^17)
ambient light     : Ambiental R, G, B, intensity(*2^17)
sun light         : Solar R, G, B, intensity(*2^17), directionX(*2^17), directionY(*2^17), directionZ(*2^17)
grid              : Grid number of points/side, stepX(*2^17),stepY(*2^17),stepZ(*2^17), centerX(*2^17),centerY(*2^17),centerZ(*2^17)
environment       : Environment 0|1 (fog on/off),fog colour(&BBGGRR00), fog intensity(*2^16), Z fog start(*2^17), Z fog intensity (*2^16), controlword
                    The control word is: (number of texture to be placed as a background(0=none))+(Xoffset<<10)+(Yoffset<<21)+2^9(if the texture must rotate with view...
number of textures: NTextures <value>
description       :    <n^texture starting from 1>: <name (the root is: !TopRes.Textures.)>, <colour to be made transparent (in 16bpp format) or 2^29 if texture is solid>
number of lights  : NLights <value>
description       :    Light 3|4|5 (spot|beam|sun), Xlight(*2^17),Ylight(*2^17),Zlight(*2^17), Xlit_point(*2^17),Ylp(*2^17),Zlp(*2^17),intensity(*2^17), C<colour number 0..511>, COS(solid angle of light (if beam light))(*2^15), lens-flare controlword1,lens-flare controlword2, drop-off dist(*2^17)

2 - objects section: you can repeat these entries several times in the file

number of colours : NColours <value>
description       :    <n^user colour   (starting from 200)> : <name (11 char max)>, R,G,B
number of mater.  : NMaterials <value>
description       :    <n^user material (starting from 100)> : <name (11 char max)>,<ambient 0..1023>,<diffuse 0..1023>,<refl_R  0..1023>+<refl_G  0..1023>+<refl_B  0..1023>,<gloss  0..63>,<trasp_R 0..1023>+<trasp_G 0..1023>+<trasp_B 0..1023>,<refractive_id 0..1023>,<preferred material colour &BBGGRR00 (or 255 to use the object colour)>
number of points  : NPoints <value>
description       :    Point <number of current point, starting from 0>: 0|1|2 (generic point | control point | sphere center), Xpoint(*2^17),Ypoint(*2^17),Zpoint(*2^17), Xnormal(*2^17),Ynormal(*2^17),Znormal(*2^17)
                       Note#1: the progressive point number (0...n^of points-1) is just for user clarity: TopModel doesn't use it during loading
                       es. Point 0     : 0, 120000,100000,120000, 131072,0,0
                       Note#2: TopModel saves point's normals but doesn't use them during loading (it recalculates them automatically).
                               Thus during loading, those values are used to specify R,G,B colour of that point for radiosity view mode...

primitives        : Poly   Nsides, SSSS,T[<n^texture>],M<n^material 0..254>,C<n^colour 0..511>, n^side1, n^side2 , ..., n^sideN

                    BezCurv SSSS,T[<n^texture>],M<n^material 0..254>,C<n^colour 0..511>, n^side1, n^side2, n^side3, n^side4

                    BezSurf Ustep, Vstep, SSSS,T[<n^texture>],M<n^material 0..254>,C<n^colour 0..511>, n^side1, n^side2, ..., n^side16

                    Sphere  SSSS,T[<n^texture>],M<n^material 0..254>,C<n^colour 0..511>, n^ of the point representing its center, n^ of the point representing its radius

                    Note: texture parameters as follows:
                          - if the object doesn't have any texture then texture number is zero and nothing else is needed: ...,T[0],M.....
                          - if the object is textured, then you have to specify the number of the texture, plus, FOR EACH SIDE OF THE OBJECT (MAINLY A POLYGON), a couple of values(*16) which
                            rapresent the texture coordinate (X,Y) in that point. For example
                            texture number 2 (for ex. a 80x60 pixel sprite). I have a triangle which is mapped with the lower right half of the texture:

                             _______________                   0
                     (0,60) |               | (80,60)        /|
                            |               |               / |
                            |  Texture 2    |              /  |
                            |  80x60 pixels |             /   |         ==>> Poly 3, SSSS,T[2, 1280,960, 0,0, 1280,0], M0, C0, 0,1,2 
                            |               |            / Triangle
                      (0,0) |_______________| (80,0)    /_____|
                                                       1       2


NB0 placing a "R" in front of the name of a primitive causes that object to be "RAW", i.e. you don't have to specify the number of the points in the point array, but directly the X,Y,Z of the
    coordinate of each point used by that kind of primitive (each point is created and inserted in the point list. Note that in this way objects are detached one each other, so you cannot
    have Gouraud or Phong shading without using the Join tool).
    ex. RPoly 3,S,T[0],M0,C0, x1(*2^17),y1(*2^17),z1(*2^17), x2(*2^17),y2(*2^17),z2(*2^17), x3(*2^17),y3(*2^17),z3(*2^17)

NB1 ALL VALUES ARE INTEGERS: you can write decimal values in the file, but they are discarded.
