home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / demos / gpc / tests / matrix.v01 < prev    next >
Encoding:
Text File  |  1991-02-13  |  14.2 KB  |  400 lines

  1. %
  2. /*--------------------------------------------------------------------*\
  3. |
  4. |   Copyright (c)1989,1990 National Computer Graphics Association
  5. |
  6. |       Permission is granted to any individual or instititution 
  7. |  to use, copy, or redistribute this software so long as it is not
  8. |    sold for profit, provided this copyright notice is retained.
  9. |
  10. |                         Developed for the
  11. |               National Computer Graphics Association
  12. |                        2722 Merrilee Drive
  13. |                         Fairfax, VA  22031
  14. |                           (703) 698-9600
  15. |
  16. |                                 by
  17. |                SimGraphics Engineering Corporation
  18. |                   1137 Huntington Drive, Suite A
  19. |                      South Pasadena, CA  91030
  20. |                           (213) 255-0900
  21. |---------------------------------------------------------------------
  22. |
  23. | Author    :    SimGraphics Engineering Corporation
  24. | File          :    transp.v01
  25. | Date          :    Tue Jul 10 16:43:18 PDT 1990
  26. | Project       :    Picture Level Benchmark
  27. | Description    :    See transp.doc
  28. | Status    :    Version 1.02
  29. | Revisions     :    1.01:  NONE
  30. |
  31. |            1.02:
  32. |            Define_light properties were changed.
  33. |
  34. |            Files transp.d02 d04 d06 d08 d10
  35. |            have been dropped.  Any verb file
  36. |            that use to call these files now call 
  37. |            files transp.d01 d03 d05 d07 d09 respectivel.
  38. |
  39. \*--------------------------------------------------------------------*/
  40. %
  41.  
  42.     Configuration rgb double_buffer true_color  ; 
  43.  
  44.     Read_geometry_file "matrix.d01"  ; 
  45.     Specify_report_file "matrix.r01"  ; 
  46.     Default_view_specification  1  500 parallel  ; 
  47.     Active_view  1  ; 
  48.     HLHS_Removal hlhs_enable ;
  49.  
  50.  
  51.     Background_color    0.100000  0.100000  0.300000 ;
  52.     Backface_interior_color  1.000000  1.000000  1.000000 ;
  53.     Interior_shading  1 ;
  54.     Interior_lighting  1 ;
  55.     Backface_processing  0  0 ;
  56.     Interior_style solid ;
  57.     Interior_color   0.500000  0.500000  0.500000 ;
  58.     Edge_flag enable ;
  59.     Edge_color  0.900000  0.900000  0.900000;
  60.  
  61.  
  62.     Translate3     11      0       -2     0    Replace  ;
  63.     Scale3      11      1       1.330000     1    Postconcat  ;
  64.  
  65.  
  66.     Matrix3     12
  67.     {  0.000000  -1.000000  0.000000  0.000000 }
  68.     {  1.330000  0.000000  0.000000  -2.660000 }
  69.     {  0.000000  0.000000  1.000000  0.000000 }
  70.     {  0.000000  0.000000  0.000000  1.000000 }
  71.     Replace;
  72.  
  73.     Matrix3     13
  74.         {     2     0     0     0    }
  75.         {     0     2     0     0    }
  76.         {     0     0     1     0    }
  77.         {     0     0     0     1    }
  78.     Replace;
  79.  
  80.  
  81.  
  82.  
  83.     Scale3      14      2       2     1    Replace  ;
  84.     Apply_to_local3  14                 Replace;
  85.     Rotate3      14      90    Z_axis        Replace  ;
  86.     Apply_to_global3  14;
  87.     Get_matrix3     14    Composite_modelling    Replace;
  88.  
  89.  
  90.     Identity3  30  ; 
  91.     Apply_to_local3  30                Replace;
  92.     Apply_to_global3  30 ;
  93.  
  94.  
  95.  
  96.     Translate3     15      0     0       -2    Replace  ;
  97.     Scale3      15      1     1       1.330000    Postconcat  ;
  98.     Rotate_XYZ3  30      90      0      -90    Replace  ;
  99.     Invert_matrix3      30 ;
  100.     Concat_matrix3      30      15         Postconcat ;
  101.     
  102.  
  103.     Translate3     16      0     -2       0    Replace  ;
  104.     Scale3      16      1     1.330000       1    Postconcat  ;
  105.     Rotate_XYZ3  16      90  0  90            Postconcat  ;
  106.     Rotate3      16      -90    X_axis        Postconcat  ;
  107.  
  108.     Scale3      17      1     2       2    Replace  ;
  109.     Rotate3      17      90    Z_axis        Postconcat  ;
  110.     Rotate3      17      -90    X_axis        Postconcat  ;
  111.  
  112.     Scale3      18      1     2       2    Replace  ;
  113.     Rotate3      18      90    X_axis        Postconcat  ;
  114.     Rotate3      18      90    Z_axis        Postconcat  ;
  115.     Rotate3      18      -90    X_axis        Postconcat  ;
  116.  
  117.  
  118.     Identity3  1  ; 
  119.     Apply_to_global3  1  ; 
  120.     Translate3     0  -375     400  0 Replace  ; % Set Initial position  %
  121.     Translate3     1  250     0  0   Replace  ;% Set Column offset     %
  122.     Translate3     2  0  -200  0    Replace  ;     % Set Row offset        %
  123.     Scale3       3  20  20  1     Replace;
  124.     Push_matrix3  ;                 % Push Initial position %
  125. % *********************************************************************** % 
  126. %                                                                         % 
  127. %                                                                         % 
  128. %                           Begin Test Loop                               % 
  129. %                                                                         % 
  130. % *********************************************************************** % 
  131. Begin_test  1  ; 
  132.     Text_prec Stroke ;
  133.     Char_exp  1 ;
  134.     Text_color  1  1  1 ;
  135.     char_height  40 ;
  136.  
  137.     Text3  -450  -450  0
  138.     "Matrix Test"
  139.     ;
  140. % *********************************************************************** % 
  141. %                           Row 1 Column 1                                %
  142. % *********************************************************************** %
  143.     Push_matrix3  ; 
  144.     Concat_matrix3  3  0 preconcat  ;
  145.     Push_matrix3  ; 
  146.     Concat_matrix3  11 0 preconcat  ;
  147.     Apply_to_global3  0  ; 
  148.     Execute_structure    1;
  149.     Pop_matrix3  ; 
  150.     Concat_matrix3  17 0 preconcat  ;
  151.     Apply_to_global3  0  ; 
  152.     Execute_structure    7;
  153.     Pop_matrix3  ; 
  154. % *********************************************************************** % 
  155. %                           Row 1 Column 2                                %
  156. % *********************************************************************** %
  157.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  158.     Push_matrix3  ; 
  159.     Concat_matrix3  3  0 preconcat  ;
  160.     Push_matrix3  ; 
  161.     Concat_matrix3  12 0 preconcat  ;
  162.     Apply_to_global3  0  ; 
  163.     Execute_structure    2;
  164.     Pop_matrix3  ; 
  165.     Concat_matrix3  14 0 preconcat  ;
  166.     Apply_to_global3  0  ; 
  167.     Execute_structure    4;
  168.     Pop_matrix3  ; 
  169. % *********************************************************************** % 
  170. %                           Row 1 Column 3                                %
  171. % *********************************************************************** %
  172.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  173.     Push_matrix3  ; 
  174.     Concat_matrix3  3  0 preconcat  ;
  175.     Push_matrix3  ; 
  176.     Concat_matrix3  13 0 preconcat  ;
  177.     Apply_to_global3  0  ; 
  178.     Execute_structure    3;
  179.     Pop_matrix3  ; 
  180.     Concat_matrix3  11 0 preconcat  ;
  181.     Apply_to_global3  0  ; 
  182.     Execute_structure    1;
  183.     Pop_matrix3  ; 
  184. % *********************************************************************** % 
  185. %                           Row 1 Column 4                                %
  186. % *********************************************************************** %
  187.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  188.     Push_matrix3  ; 
  189.     Concat_matrix3  3  0 preconcat  ;
  190.     Push_matrix3  ; 
  191.     Concat_matrix3  14 0 preconcat  ;
  192.     Apply_to_global3  0  ; 
  193.     Execute_structure    4;
  194.     Pop_matrix3  ; 
  195.     Concat_matrix3  12 0 preconcat  ;
  196.     Apply_to_global3  0  ; 
  197.     Execute_structure    2;
  198.     Pop_matrix3  ; 
  199. % *********************************************************************** % 
  200. %                           Row 2 Column 1                                %
  201. % *********************************************************************** %
  202.     Pop_matrix3  ; 
  203.     Concat_matrix3  2  0 postconcat  ;         % Move down one row %
  204.     Push_matrix3  ; 
  205.     Push_matrix3  ; 
  206.     Concat_matrix3  3  0 preconcat  ;
  207.     Push_matrix3  ; 
  208.     Concat_matrix3  15 0 preconcat  ;
  209.     Apply_to_global3  0  ; 
  210.     Execute_structure    5;
  211.     Pop_matrix3  ; 
  212.     Concat_matrix3  18 0 preconcat  ;
  213.     Apply_to_global3  0  ; 
  214.     Execute_structure    8;
  215.     Pop_matrix3  ; 
  216. % *********************************************************************** % 
  217. %                           Row 2 Column 2                                %
  218. % *********************************************************************** %
  219.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  220.     Push_matrix3  ; 
  221.     Concat_matrix3  3  0 preconcat  ;
  222.     Push_matrix3  ; 
  223.     Concat_matrix3  16 0 preconcat  ;
  224.     Apply_to_global3  0  ; 
  225.     Execute_structure    6;
  226.     Pop_matrix3  ; 
  227.     Concat_matrix3  13 0 preconcat  ;
  228.     Apply_to_global3  0  ; 
  229.     Execute_structure    3;
  230.     Pop_matrix3  ; 
  231. % *********************************************************************** % 
  232. %                           Row 2 Column 3                                %
  233. % *********************************************************************** %
  234.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  235.     Push_matrix3  ; 
  236.     Concat_matrix3  3  0 preconcat  ;
  237.     Push_matrix3  ; 
  238.     Concat_matrix3  17 0 preconcat  ;
  239.     Apply_to_global3  0  ; 
  240.     Execute_structure    7;
  241.     Pop_matrix3  ; 
  242.     Concat_matrix3  15 0 preconcat  ;
  243.     Apply_to_global3  0  ; 
  244.     Execute_structure    5;
  245.     Pop_matrix3  ; 
  246. % *********************************************************************** % 
  247. %                           Row 2 Column 4                                %
  248. % *********************************************************************** %
  249.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  250.     Push_matrix3  ; 
  251.     Concat_matrix3  3  0 preconcat  ;
  252.     Push_matrix3  ; 
  253.     Concat_matrix3  18 0 preconcat  ;
  254.     Apply_to_global3  0  ; 
  255.     Execute_structure    8;
  256.     Pop_matrix3  ; 
  257.     Concat_matrix3  16 0 preconcat  ;
  258.     Apply_to_global3  0  ; 
  259.     Execute_structure    6;
  260.     Pop_matrix3  ; 
  261. % *********************************************************************** % 
  262. %                           Row 3 Column 1                                %
  263. % *********************************************************************** %
  264.     Pop_matrix3  ; 
  265.     Concat_matrix3  2  0 postconcat  ;         % Move down one row %
  266.     Push_matrix3  ; 
  267.     Push_matrix3  ; 
  268.     Concat_matrix3  3  0 preconcat  ;
  269.     Push_matrix3  ; 
  270.     Concat_matrix3  11 0 preconcat  ;
  271.     Apply_to_global3  0  ; 
  272.     Execute_structure    1;
  273.     Pop_matrix3  ; 
  274.     Concat_matrix3  17 0 preconcat  ;
  275.     Apply_to_global3  0  ; 
  276.     Execute_structure    7;
  277.     Pop_matrix3  ; 
  278. % *********************************************************************** % 
  279. %                           Row 3 Column 2                                %
  280. % *********************************************************************** %
  281.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  282.     Push_matrix3  ; 
  283.     Concat_matrix3  3  0 preconcat  ;
  284.     Push_matrix3  ; 
  285.     Concat_matrix3  12 0 preconcat  ;
  286.     Apply_to_global3  0  ; 
  287.     Execute_structure    2;
  288.     Pop_matrix3  ; 
  289.     Concat_matrix3  14 0 preconcat  ;
  290.     Apply_to_global3  0  ; 
  291.     Execute_structure    4;
  292.     Pop_matrix3  ; 
  293. % *********************************************************************** % 
  294. %                           Row 3 Column 3                                %
  295. % *********************************************************************** %
  296.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  297.     Push_matrix3  ; 
  298.     Concat_matrix3  3  0 preconcat  ;
  299.     Push_matrix3  ; 
  300.     Concat_matrix3  13 0 preconcat  ;
  301.     Apply_to_global3  0  ; 
  302.     Execute_structure    3;
  303.     Pop_matrix3  ; 
  304.     Concat_matrix3  11 0 preconcat  ;
  305.     Apply_to_global3  0  ; 
  306.     Execute_structure    1;
  307.     Pop_matrix3  ; 
  308. % *********************************************************************** % 
  309. %                           Row 3 Column 4                                %
  310. % *********************************************************************** %
  311.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  312.     Push_matrix3  ; 
  313.     Concat_matrix3  3  0 preconcat  ;
  314.     Push_matrix3  ; 
  315.     Concat_matrix3  14 0 preconcat  ;
  316.     Apply_to_global3  0  ; 
  317.     Execute_structure    4;
  318.     Pop_matrix3  ; 
  319.     Concat_matrix3  12 0 preconcat  ;
  320.     Apply_to_global3  0  ; 
  321.     Execute_structure    2;
  322.     Pop_matrix3  ; 
  323. % *********************************************************************** % 
  324. %                           Row 4 Column 1                                %
  325. % *********************************************************************** %
  326.     Pop_matrix3  ; 
  327.     Concat_matrix3  2  0 postconcat  ;         % Move down one row %
  328.     Push_matrix3  ; 
  329.     Push_matrix3  ; 
  330.     Concat_matrix3  3  0 preconcat  ;
  331.     Push_matrix3  ; 
  332.     Concat_matrix3  15 0 preconcat  ;
  333.     Apply_to_global3  0  ; 
  334.     Execute_structure    5;
  335.     Pop_matrix3  ; 
  336.     Concat_matrix3  18 0 preconcat  ;
  337.     Apply_to_global3  0  ; 
  338.     Execute_structure    8;
  339.     Pop_matrix3  ; 
  340. % *********************************************************************** % 
  341. %                           Row 4 Column 2                                %
  342. % *********************************************************************** %
  343.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  344.     Push_matrix3  ; 
  345.     Concat_matrix3  3  0 preconcat  ;
  346.     Push_matrix3  ; 
  347.     Concat_matrix3  16 0 preconcat  ;
  348.     Apply_to_global3  0  ; 
  349.     Execute_structure    6;
  350.     Pop_matrix3  ; 
  351.     Concat_matrix3  13 0 preconcat  ;
  352.     Apply_to_global3  0  ; 
  353.     Execute_structure    3;
  354.     Pop_matrix3  ; 
  355. % *********************************************************************** % 
  356. %                           Row 4 Column 3                                %
  357. % *********************************************************************** %
  358.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  359.     Push_matrix3  ; 
  360.     Concat_matrix3  3  0 preconcat  ;
  361.     Push_matrix3  ; 
  362.     Concat_matrix3  17 0 preconcat  ;
  363.     Apply_to_global3  0  ; 
  364.     Execute_structure    7;
  365.     Pop_matrix3  ; 
  366.     Concat_matrix3  15 0 preconcat  ;
  367.     Apply_to_global3  0  ; 
  368.     Execute_structure    5;
  369.     Pop_matrix3  ; 
  370. % *********************************************************************** % 
  371. %                           Row 4 Column 4                                %
  372. % *********************************************************************** %
  373.     Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  374.     Push_matrix3  ; 
  375.     Concat_matrix3  3  0 preconcat  ;
  376.     Push_matrix3  ; 
  377.     Concat_matrix3  18 0 preconcat  ;
  378.     Apply_to_global3  0  ; 
  379.     Execute_structure    8;
  380.     Pop_matrix3  ; 
  381.     Concat_matrix3  0 0 preconcat  ;
  382.     Apply_to_global3  0  ; 
  383.    Local_transformation3
  384.     {  0.000004  -0.000005  20.000000  375.000000 }
  385.     {  0.000004  26.600000  0.000004  -253.199997 }
  386.     {  -1.000000  0.000000  0.000000  0.000000 }
  387.     {  0.000000  0.000000  0.000000  1.000000 }
  388.     Replace
  389.    ;
  390.    Global_transformation3
  391.     {  1.000000  0.000000  0.000000  0.000000 }
  392.     {  0.000000  1.000000  0.000000  0.000000 }
  393.     {  0.000000  0.000000  1.000000  0.000000 }
  394.     {  0.000000  0.000000  0.000000  1.000000 }
  395.    ;
  396.     Execute_structure    6;
  397.     Pop_matrix3  ; 
  398. End_test  ; 
  399. Sleep 5 ;
  400.