POLYX HELP
A fast briefing about POLYX

______________________________________________
**********************************************

     Developing an 3D OBJECT

**********************************************




---------------------------------------------
Important properties & procedures
---------------------------------------------
OBJ3D Properties
      XTR
             x       Position X
             y       Position Y
             z       Position Z
             sx      Scale    X
             sy      Scale    Y
             sz      Scale    Z
             flags   ObjectRenderOption
                |
                + --   * (tranformation)
                         [XTDINAMYC, XTNONE, XTSTATIC]
                       * (lightning)
                         [XLNONE, XLDIFFUSION, XLSPECULAR, XLENVSPECULAR]
                       * (vector normaling)
                         [XLRENORMAL]

Obj3D Procedures

      ROTT(angle1,angle2,angle3)

<see demo programs>

-----------------------------------------------
Creating an Object
-----------------------------------------------
<instant creation>
 * Make a ball
        MAKEBALL4( obj              : OBJ3D
                    rad1 , rad2      : Integer     * to make a ball, rad1=rad2
                    R,G,B            : Integer     * Colors
                    FaceStatus       : Integer     * See <face status>
                    DetailHorizontal : Integer
                    DetailVertical   : Integer
                  )
   Make a torus
        MAKETORUS ( obj              : OBJ3D
                    rad1 , rad2      : Integer     * innner and outer radius
                    R,G,B            : Integer     * Colors
                    FaceStatus       : Integer     * See <face status>
                    DetailHorizontal : Integer
                    DetailVertical   : Integer
                  )
   Make a pipe
        MAKEPIPE  ( obj              : OBJ3D
                    rad1 , rad2      : Integer     * innner and outer radius
                    R,G,B            : Integer     * Colors
                    FaceStatus       : Integer     * See <face status>
                    Detail           : Integer
                  )

*******************
< manual creation >
*******************

    Vertex and face is 3dimentional object main component.
    Vertex properties are

           VERTEX -+CRD   - X,Y,Z : Single      * Coordinate
                   +ncrd  - NX,NY,Nz :Single    * Normal vector
                   +Gclr  - R,G,B : Integer     * Color
                   +Tcrd  - U,V   : Integer     * Texture coordinate
           FACE   -V1,V2,V3,V4    : Integer     * Point into 4 differext vertexs to
                                                  create a polygon
                   STATUS         : Integer     * Rendering status
                   COLOR          : Integer     * If polygon is flat

*     <Create object>
       Call obj3d.Init first
-Program--------------------
          var ball:Obj3d;

       begin
            ....
            ball.init;
----------------------------
       Then call obj3d.create to allocate memory for face and vertex and lockobj
       to get the object avaiable.

-Program--------------------
            ball.Create(NumVertexs,NumFaces)
            lockobj(ball);
----------------------------
       To set vertex call SETVERTEX and SETNVERTEX to set normal vertex
       SETVERTEX ( NoVertex,
                   X,Y,Z,R,G,B,A,U,V
                 )
       SETNVERTEX ( NoVertex,
                    NX,NY,NZ
                 )
       To set face call SETFACE
       SETFACE ( NoFace,
                 V1,V2,V3,V4,STATUS,COLOR
               )
       if you want to create a triangles, give V4 with (-1)


       If you want to calculate object normal vectors, call CACHENORMAL first before
       call RENORMAL, but first set its flags

-Program--------------------
            ...
            ball.Xtr.Flags:=ObjectRenderOption;           <see upper>
            CACHENORMAL(ball);
            RENORMAL(Ball);
----------------------------

       then if you want to render just call obj3d.render;
-Program--------------------
            ...
            BIO(Resetprim);
            ...
            ball.render
            ...
            Showframe;
----------------------------




*     <Face status>
       Rendering status is a group of constant :
                 * unit mode = [ UTGUROUD,UTFLAT,UTGUROUDTEX,UTFLATTEX ]
                 * alpha mode= which way polygon blended into destination frame
                               [ BLENDNONE,BLENDADD,BLENDMUL,BLENDTRUE ]
                           * blendtrue use more parameter see <GETSTATUS>
                 * texture combine mode = which way texture combined with polygon color
                               [ TCNONE, TCADDRGB, TCMULRGB ]
                 * face mode = use this to avoid backface filtering
                               [ FCCULL ]

       Every state puts in STATUS bits, so its difficult to set this malually. Use
       GETSTATUS to create a polygon status.

*      <GETSTATUS>
        GETSTATUS( UnitMode
                   AlphaMode
                   TextureCombinationMode
                   TextureHandler
                   BlendTrueParameter
                   FaceMode
                 )

