<MAIN> myscript |0|1</MAIN>

<KIMG> logo1 | data/1-1.iff </KIMG>
<KIMG> logo2 | data/1-2.iff </KIMG>
<KIMG> logo3 | data/1-3.iff </KIMG>
<KIMG> logo4 | data/1-4.iff </KIMG>
<KIMG> logo5 | data/1-5.iff </KIMG>
<KIMG> logo6 | data/2-1.iff </KIMG>
<KIMG> logo7 | data/2-2.iff </KIMG>
<KIMG> 333 | data/3.iff </KIMG>
<KIMG> 4441 | data/4-1.iff </KIMG>
<KIMG> 4442 | data/4-2.iff </KIMG>
<KIMG> 555-1 | data/5-1.iff </KIMG>
<KIMG> 555-2 | data/5-2.iff </KIMG>
<KIMG> 6 | data/6.iff </KIMG>
<KIMG> 777 | data/7.iff </KIMG>
<KIMG> 8-1 | data/8-1.iff </KIMG>
<KIMG> 8-2 | data/8-2.iff </KIMG>
<KIMG> 8-3 | data/8-3.iff </KIMG>

<imgempty> renderimage | 256 | 256 | 65 </imgempty>
<auxrect> TextureRectangle | renderimage  </auxrect>

<KDBM> DBMmusic | data/sos_by_slash_atd_rpsg.dbm  </KDBM>

<KCAM> cam_1 |0|0|0|0|0|0|1  </KCAM> camera (x,y,z,o1,o2,o3,FOV)

<KCAM> the_camera2 |0|0|-3|0|0|0|0.5  </KCAM>
<World3D> world2 </World3D> create an empty world.
<t3dFlat> texture10 | 24  </t3dFlat> color number.
<t3dFlat> texture11 | 25  </t3dFlat>
<t3dFlat> texture12 | 26  </t3dFlat>
<t3dFlat> texture13 | 27  </t3dFlat> color number.
<t3dFlat> texture14 | 28  </t3dFlat>
<t3dFlat> texture15 | 29  </t3dFlat>
<cube> our_cube2 | world2 |0|0|0|0|0|0|1|1|1 |texture10 |texture11 |texture12 |texture13 |texture14| texture15 </cube>
         initial position(x,y,z), rotation(o1,o2,o3), scale (sx,sy,sz), textures,...




<KSCRIPT>
    <ID> myscript </ID>
	<PLAY> blankpart | 210 | 0 | 1 </PLAY>210
	<PLAY> logo2 | 110 | 0 | 1 </PLAY>110
	<PLAY> logo3 | 110 | 0 | 1 </PLAY>110
	<PLAY> logo4 | 110 | 0 | 1 </PLAY>110
	<PLAY> logo5 | 110 | 0 | 1 </PLAY>110
	<PLAY> logo1 | 200 | 0 | 1 </PLAY>200
	<PLAY> blankpart | 25 | 0 | 1 </PLAY>25
	<PLAY> logo6 | 200 | 0 | 1 </PLAY>200
	<PLAY> logo7 | 180 | 0 | 1 </PLAY>180
	<PLAY> blankpart | 25 | 0 | 1 </PLAY>25
	<PLAY> scene3 | 335 | 0 | 1 </PLAY>335
	<PLAY> blankpart | 25 | 0 | 1 </PLAY>25
	<PLAY> scene4 | 350 | 0 | 1 </PLAY>
	<PLAY> blankpart | 25 | 0 | 1 </PLAY>25
	<PLAY> scene5 | 350 | 0 | 1 </PLAY>
	<PLAY> blankpart | 25 | 0 | 1 </PLAY>25
	<PLAY> scene6 | 545 | 0 | 1 </PLAY>
	<PLAY> blankpart | 25 | 0 | 1 </PLAY>25
	<PLAY> scene7 | 535 | 0 | 1 </PLAY>
	<PLAY> blankpart | 25 | 0 | 1 </PLAY>25
	<PLAY> scene8 | 99999 | 0 | 1 </PLAY>


</KSCRIPT>


<KPART>

    <Fx><Pa> PlayDBM</Pa>
        <Pa> DBMmusic   </Pa>
    </Fx>


    <ID> blankpart  </ID>
    <Fx><Pa> FillRc </Pa><Pa></Pa><Pa>cte| 0 </Pa></Fx>
</KPART>

----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> logo1 </ID>


    <Fx>
        <Pa> Sprite </Pa>
        <Pa> </Pa>
        <Pa> logo1 </Pa>    
        <Pa> cte |0 </Pa> 
        <Pa> cte |0 </Pa> 
        <Pa> cte |0.999 </Pa> 
        <Pa> cte |0.999 </Pa> 
    </Fx>

</KPART>

----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> logo2 </ID>

    <Fx>
        <Pa>setpalette</Pa>
        <Pa> logo1 </Pa>
    </Fx>

    <Fx>
        <Pa> SpritePlain </Pa>
        <Pa> </Pa>
        <Pa> logo2 </Pa>    
        <Pa> rnd |0 | 0.006</Pa> 
        <Pa> rnd |0.5 | 0.506</Pa> 
        <Pa> rnd |0.999 | 0.993</Pa> 
        <Pa> rnd |0.59375 | 0.58775</Pa> 
    </Fx>

</KPART>

----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> logo3 </ID>

    <Fx>
        <Pa> SpritePlain </Pa>
        <Pa> </Pa>
        <Pa> logo3 </Pa>    
        <Pa> rnd |0 | 0.006</Pa> 
        <Pa> rnd |0.5 | 0.506</Pa> 
        <Pa> rnd |0.999 | 0.993</Pa> 
        <Pa> rnd |0.59375 | 0.58775</Pa> 
    </Fx>

</KPART>

----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> logo4 </ID>

    <Fx>
        <Pa> SpritePlain </Pa>
        <Pa> </Pa>
        <Pa> logo4 </Pa>    
        <Pa> rnd |0 | 0.006</Pa> 
        <Pa> rnd |0.5 | 0.506</Pa> 
        <Pa> rnd |0.999 | 0.993</Pa> 
        <Pa> rnd |0.59375 | 0.58775</Pa> 
    </Fx>

</KPART>
----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> logo5 </ID>

    <Fx>
        <Pa> SpritePlain </Pa>
        <Pa> </Pa>
        <Pa> logo5 </Pa>    
        <Pa> rnd |0 | 0.006</Pa> 
        <Pa> rnd |0.5 | 0.506</Pa> 
        <Pa> rnd |0.999 | 0.993</Pa> 
        <Pa> rnd |0.59375 | 0.58775</Pa> 
    </Fx>

</KPART>

----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> logo6 </ID>

    <Fx>
        <Pa>setpalette</Pa>
        <Pa> logo6 </Pa>
    </Fx>

    <Fx>
        <Pa> SpritePlain </Pa>
        <Pa> </Pa>
        <Pa> logo6 </Pa>    
        <Pa> cte |0 </Pa> 
        <Pa> cte |0 </Pa> 
        <Pa> cte |0.999 </Pa> 
        <Pa> cte |0.999 </Pa> 
    </Fx>

</KPART>

----------------------------------------------------------------------------------------------------------------
<KPART>
<ID> logo7 </ID>

    <Fx>
        <Pa> Sprite </Pa>
        <Pa> </Pa>
        <Pa> logo7 </Pa>    
        <Pa> cte |0 </Pa> 
        <Pa> cte |0.2 </Pa> 
        <Pa> cte |0.999 </Pa> 
        <Pa> cte |0.325 </Pa> 
    </Fx>

</KPART>

----------------------------------------------------------------------------------------------------------------
<KPART>
<ID> scene3 </ID>

    <Fx>
        <Pa>setpalette</Pa>
        <Pa> 333 </Pa>
    </Fx>

<World3D> world1 </World3D> create an empty world.
<t3dFlat> texture0 | 4  </t3dFlat> color number.
<t3dFlat> texture1 | 5  </t3dFlat>
<t3dFlat> texture2 | 6  </t3dFlat>
<t3dFlat> texture3 | 7  </t3dFlat>
<t3dFlat> texture4 | 8  </t3dFlat>
<t3dFlat> texture5 | 9  </t3dFlat>
<cube> our_cube | world1 |0|0|0|0|0|0|1|1|1 |texture0 |texture1 |texture2 |texture3 |texture4| texture5 </cube>
<KCAM> cam_2 |0|0|-3|0|0|0|0.5  </KCAM>

 First draw some effect on the rectangle:

    <Fx><Pa>fillrc</Pa>  clear the screen background to color 0.
        <Pa> TextureRectangle </Pa>   default screen rectangle.
        <Pa> cte | 0 </Pa>
    </Fx>

    <Fx><Pa> Set3DObject </Pa>      make the cube rotate all the time on the 3 axis:
        <Pa>  our_cube </Pa>        (note our_cube is attached to world1.)

        <Pa> 3cte |0|0|0  </Pa>     set at position 0,0,0

        <Pa> aff |0.4|0.006 </Pa>   rotation: make angles follow affine curve.
        <Pa> aff |0.6|0.01</Pa>
        <Pa> aff |0.8|0.00</Pa>

        <Pa> 3cte|1|1|1 </Pa>       scale always set to 1,1,1.
    </Fx>
    <Fx><Pa> Draw3DWorld </Pa>
          <Pa> TextureRectangle </Pa>
          <Pa> world1 </Pa>
          <Pa> cam_2 </Pa>
          <Pa> cte|0 </Pa>
          <Pa> cte|0.25 </Pa>
          <Pa> cte|20</Pa>
      </Fx>
 
 Then draw a deformation effect using this image, on the screen default rectangle:

   <Fx>
        <Pa> Twirl </Pa>
        <Pa></Pa>
        <Pa> renderimage  </Pa>

        <Pa>cte|0.5</Pa> ofsx
        <Pa>cte|0.5</Pa> ofsY

        <Pa>SIN|0|0.1|1</Pa> start angle
        <Pa>CTE|0</Pa>    amp. angle
        <Pa>CTE|0</Pa>    freq angle

        <Pa>CTE|0</Pa>         start dist.
        <Pa>SIN|0|0.6|0.25</Pa> amp.dist
        <Pa>COS|0|0.2|32</Pa> freq dist

        <Pa>CTE|0</Pa> mapping type
    </Fx>


    <Fx>
        <Pa> Sprite </Pa>
        <Pa> </Pa>
        <Pa> 333 </Pa>    
        <Pa> cte |0 </Pa> 
        <Pa> cte |0 </Pa> 
        <Pa> cte |1 </Pa> 
        <Pa> cte |1 </Pa> 
    </Fx>


</KPART>
----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> scene4 </ID>



    <Fx>
        <Pa>setpalette</Pa>
        <Pa> 4441 </Pa>
    </Fx>


    <Fx>
        <Pa> SpritePlain </Pa>
        <Pa> </Pa>
        <Pa> 4441 </Pa>    
        <Pa> cte |0 </Pa> 
        <Pa> cte |0 </Pa> 
        <Pa> cte |0.999 </Pa> 
        <Pa> cte |0.999 </Pa> 
    </Fx>




    <Fx><Pa> Set3DObject </Pa>      make the cube rotate all the time on the 3 axis:
        <Pa>  our_cube2 </Pa>        (note our_cube is attached to world1.)

        <Pa> 3cte |0|0|0  </Pa>     set at position 0,0,0

        <Pa> aff |0.4|0.006 </Pa>   rotation: make angles follow affine curve.
        <Pa> aff |0.6|0.01</Pa>
        <Pa> aff |0.8|0.00</Pa>

        <Pa> 3cte|1|1|1 </Pa>       scale always set to 1,1,1.
    </Fx>



      <Fx><Pa> Draw3DWorld </Pa>
            <Pa>   </Pa>        the rectangle where to draw (here: default)
            <Pa> world2 </Pa>      the 3D world to draw !
            <Pa> the_camera2 </Pa>  note camera postion is 0,0,-3, looking 0,0,0.
            <Pa> cte|0 </Pa>       time march, may be used for some lightwave stuffs...
            <Pa> cte|0.25 </Pa>    near-cut-plane distance to camera (must be >0)
            <Pa> cte|20</Pa>       far-cut-plane distance to camera (must be >near)
        </Fx>


    <Fx>
        <Pa> Sprite </Pa>
        <Pa> </Pa>
        <Pa> 4442 </Pa>    
        <Pa> cte |0 </Pa> 
        <Pa> cte |0 </Pa> 
        <Pa> cte |0.999 </Pa> 
        <Pa> cte |0.999 </Pa> 
    </Fx>




</KPART>
----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> scene5 </ID>

    <Fx>
        <Pa>setpalette</Pa>
        <Pa> 6 </Pa>
    </Fx>


    <Fx>
        <Pa>Maprect </Pa>
        <Pa> </Pa>
        <Pa> 6 </Pa>
        <Pa>4CTE|0|0.1484|1|0.8515</Pa>

        <Pa>cos|128|0.2|120</Pa>
        <Pa>sin|128|0.2|120</Pa>

        <Pa>COS|128|0.39|11|120</Pa>
        <Pa>SIN|128|0.39|120</Pa>

        <Pa>cos|128|0.3|128</Pa>
        <Pa>SIN|128|0.3|128</Pa>

        <Pa>COS|128|0.15|120</Pa>
        <Pa>SIN|128|0.15|120</Pa>

    </Fx>


</KPART>
----------------------------------------------------------------------------------------------------------------


<KPART>
<ID> scene6 </ID>

    <Fx>
        <Pa>setpalette</Pa>
        <Pa> 555-1 </Pa>
    </Fx>


   <Fx>
        <Pa>Sprite</Pa>
        <Pa></Pa>
        <Pa>  555-2 </Pa>
        <Pa> sin | -0.5 | 0.1484 | 0.25 </pa>
        <Pa> cte | 0.1484  </pa>
        <Pa> sin | 1.499 | 0.1484 | 0.25 </pa>
        <Pa> cte | 0.8515  </pa>

    </Fx>


    <Fx>
        <Pa>Sprite</Pa>
        <Pa></Pa>
        <Pa> 555-1 </Pa>
        <Pa> sin | 0.15 | 0.5 | 0.05</pa> X1 / speed / amplitude . A + sin (B*t) * C ?
        <Pa> cos | 0.1875 | 0.5 | 0.05</pa> Y1
        <Pa> sin | 0.85 | 0.5 | 0.05</pa> X2
        <Pa> cos | 0.8125 | 0.5 | 0.05</pa> Y2
    </Fx>

</KPART>
----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> scene7 </ID>

    <Fx>
        <Pa>setpalette</Pa>
        <Pa> 777 </Pa>
    </Fx>


    <Fx>
        <Pa> Twirl </Pa>                some normal twirl on the background.
        <Pa></Pa>
        <Pa> 777 </Pa>

        <Pa>SIN|0|1|0.25</Pa> ofsx
        <Pa>COS|0|1|0.25</Pa> ofsY

        <Pa>SIN|0|0.1|1</Pa> start angle
        <Pa>CTE|0</Pa>    amp. angle
        <Pa>CTE|0</Pa>    freq angle

        <Pa>CTE|0</Pa>         start dist.
        <Pa>SIN|0|0.6|0.5</Pa> amp.dist
        <Pa>COS|0|0.2|32</Pa> freq dist

        <Pa>CTE|0</Pa> mapping type
    </Fx>

    <Fx>
        <Pa> Sprite </Pa>
        <Pa> </Pa>
        <Pa> 333 </Pa>    
        <Pa> cte |0 </Pa> 
        <Pa> cte |0 </Pa> 
        <Pa> cte |1 </Pa> 
        <Pa> cte |1 </Pa> 
    </Fx>
  
</KPART>
----------------------------------------------------------------------------------------------------------------

<KPART>
<ID> scene8 </ID>

    <Fx>
        <Pa>setpalette</Pa>
        <Pa> 8-1 </Pa>
    </Fx>


    <Fx>
        <Pa> SpritePlain </Pa>
        <Pa> </Pa>
        <Pa> 8-1 </Pa>    
        <Pa> cte |0 </Pa> 
        <Pa> cte |0 </Pa> 
        <Pa> cte |0.999 </Pa> 
        <Pa> cte |0.999 </Pa> 
    </Fx>


    <Fx>
        <Pa> Sprite </Pa>
        <Pa> </Pa>
        <Pa> 8-3 </Pa>    
        <Pa> rnd |0.375 | 0.381</Pa> 
        <Pa> rnd |0.44375 | 0.43975</Pa> 
        <Pa> rnd |0.625 | 0.619</Pa> 
        <Pa> rnd |0.75625 | 0.75025</Pa> 
    </Fx>


    <Fx>
        <Pa> Sprite </Pa>
        <Pa> </Pa>
        <Pa> 8-2 </Pa>    
        <Pa> rnd |0.225 | 0.231</Pa> 
        <Pa> rnd |0.35 | 0.356</Pa> 
        <Pa> rnd |0.775 | 0.769</Pa> 
        <Pa> rnd |0.85 | 0.844</Pa> 
    </Fx>



</KPART>
