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

  1. %
  2. /*--------------------------------------------------------------------*\
  3. |
  4. |   Copyright (c)1989,1990,1991 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          :    ambient.v04
  25. | Date          :    Tue Jul 10 16:43:18 PDT 1990
  26. | Project       :    Picture Level Benchmark
  27. | Description    :    See ambient.doc
  28. | Status    :    Version 1.02
  29. | Revisions     :    1.01: Apply_to_global3 removed from data file 
  30. |            and moved to inside test loop.  This eased
  31. |            problems for PHIGS ports.
  32. |
  33. |            1.02:
  34. |            Files ambient.d02 d04 d06 d08 d10 d12 d14 
  35. |            have been dropped.  Any verb file
  36. |            that use to call these files now call 
  37. |            files ambient.d01 d03 d05 d07 d09 d11 d13
  38. |            respectively.
  39. |            DAC: Reversed order of vertices of 1st polygon
  40. |                       in data files to make it backfacing.
  41. |
  42. \*--------------------------------------------------------------------*/
  43. %
  44.  
  45.     Configuration rgb double_buffer true_color  ; 
  46.     Read_geometry_file "ambient.d03";
  47.     Specify_report_file "ambient.r04";
  48.     Default_view_specification  1  500 perspective;
  49.     Active_view  1  ; 
  50.  
  51. % *********************************************************************** % 
  52. % Set up static attributes                                                %
  53. % *********************************************************************** % 
  54.     HLHS_Removal hlhs_disable ;
  55.     Text_prec Stroke ;
  56.     Char_exp  1 ;
  57.     Text_color  1  1  1 ;
  58.     char_height  30 ;
  59.     Background_color    0.300000  0.300000  0.800000 ;
  60.     Interior_style solid ;
  61.     Interior_color  1.000000  1.000000  1.000000 ;
  62.     Backface_interior_color  1.000000  1.000000  1.000000 ;
  63.     Interior_lighting  2 ;
  64.     Edge_flag enable ;
  65.     Edge_type  0 ;
  66.     Edge_color  1.000000  0.800000  0.600000 ;
  67.  
  68. % ****************************************************************** %
  69. % Set up matrix for position geometry on the screen                  %
  70. % ****************************************************************** %
  71.     Identity3  0  ; 
  72.     Apply_to_global3  0  ; 
  73.  
  74.     Translate3  0  -375   375  0 Replace  ;     % Set Initial position  %
  75.     Push_matrix3  ;                 % Push Initial position %
  76.  
  77.     Translate3  1   250     0  0 Replace  ;     % Set Column offset     %
  78.     Translate3  2     0  -250  0 Replace  ;     % Set Row offset        %
  79.  
  80. % Create a ramped light table %
  81.     Define_light
  82.       % Index in light source table  %  1
  83.       % Light source color components %  1.000000    1.000000    1.000000
  84.       % Non-directional light source  % Ambient_light
  85.      ; 
  86.     Define_light
  87.       % Index in light source table  %  2
  88.       % Light source color components %  1.000000    0.660000   0.660000
  89.       % Non-directional light source  % Ambient_light
  90.      ; 
  91.     Define_light
  92.       % Index in light source table  %  3
  93.       % Light source color components %  1.000000    0.330000   0.330000
  94.       % Non-directional light source  % Ambient_light
  95.      ; 
  96.     Define_light
  97.       % Index in light source table  %  4
  98.       % Light source color components %  1.000000    0.000000    0.000000
  99.       % Non-directional light source  % Ambient_light
  100.      ; 
  101.  
  102.  
  103. % *********************************************************************** % 
  104. %                                                                         % 
  105. %                                                                         % 
  106. %                           Begin Test Loop                               % 
  107. %                                                                         % 
  108. % *********************************************************************** % 
  109. Begin_test  1  ; 
  110.     Text3  -450  -450  0 "Ambient Test: POLY3 true perspective";
  111.     Text3  -450  -495  0 "ambient.v04";
  112.  
  113. % *********************************************************************** % 
  114. %                           Row 1 Column 1                                %
  115. % *********************************************************************** %
  116.   Interior_shading  1; 
  117.   Surface_properties
  118.     % Ambient reflection coefficient     %  0.000000
  119.     % Diffuse reflection coefficient    %  0.000000
  120.     % Specular reflection coefficient    %  0.000000
  121.     % Specularity true-color components %  0.000000  0.000000  0.000000
  122.     % Specular exponent                 %  0.000000
  123.     % Transparency coefficient          %  1.000000
  124.    ; 
  125.   Backface_properties
  126.     % Ambient reflection coefficient     %  1.000000
  127.     % Diffuse reflection coefficient    %  0.000000
  128.     % Specular reflection coefficient    %  0.000000
  129.     % Specularity true-color components %  0.000000  0.000000  0.000000
  130.     % Specular exponent                 %  0.000000
  131.     % Transparency coefficient          %  1.000000
  132.    ; 
  133.   Backface_processing
  134.     % Backfacing polygons are identified % 1
  135.     % No backface culling                % 0; 
  136.   Light_state
  137.     activate_list
  138.     {  1    }
  139.     deactivate_list
  140.     {  2    }
  141.    ;
  142.   Apply_to_global3  0  ; 
  143.   Execute_structure 20  ; 
  144.   
  145.  
  146. % *********************************************************************** % 
  147. %                           Row 1 Column 2                                %
  148. % *********************************************************************** %
  149.   Interior_shading  2; 
  150.   Surface_properties
  151.     % Ambient reflection coefficient     %  0.250000
  152.     % Diffuse reflection coefficient    %  0.000000
  153.     % Specular reflection coefficient    %  0.000000
  154.     % Specularity true-color components %  0.000000  0.000000  0.000000
  155.     % Specular exponent                 %  0.000000
  156.     % Transparency coefficient          %  1.000000
  157.    ; 
  158.   Backface_properties
  159.     % Ambient reflection coefficient     %  0.750000
  160.     % Diffuse reflection coefficient    %  0.000000
  161.     % Specular reflection coefficient    %  0.000000
  162.     % Specularity true-color components %  0.000000  0.000000  0.000000
  163.     % Specular exponent                 %  0.000000
  164.     % Transparency coefficient          %  1.000000
  165.    ; 
  166.   Backface_processing
  167.     % Backfacing polygons are identified % 1
  168.     % No backface culling                % 0; 
  169.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  170.   Apply_to_global3  0  ; 
  171.   Call_structure 20  ; 
  172.   
  173.  
  174. % *********************************************************************** % 
  175. %                           Row 1 Column 3                                %
  176. % *********************************************************************** %
  177.   Interior_shading  3; 
  178.   Surface_properties
  179.     % Ambient reflection coefficient     %  0.750000
  180.     % Diffuse reflection coefficient    %  0.000000
  181.     % Specular reflection coefficient    %  0.000000
  182.     % Specularity true-color components %  0.000000  0.000000  0.000000
  183.     % Specular exponent                 %  0.000000
  184.     % Transparency coefficient          %  1.000000
  185.    ; 
  186.   Backface_properties
  187.     % Ambient reflection coefficient     %  0.250000
  188.     % Diffuse reflection coefficient    %  0.000000
  189.     % Specular reflection coefficient    %  0.000000
  190.     % Specularity true-color components %  0.000000  0.000000  0.000000
  191.     % Specular exponent                 %  0.000000
  192.     % Transparency coefficient          %  1.000000
  193.    ; 
  194.   Backface_processing
  195.     % Backfacing polygons are identified % 1
  196.     % No backface culling                % 0; 
  197.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  198.   Apply_to_global3  0  ; 
  199.   Execute_structure 20  ; 
  200.   
  201.  
  202. % *********************************************************************** % 
  203. %                           Row 1 Column 4                                %
  204. % *********************************************************************** %
  205.   Interior_shading  4; 
  206.   Surface_properties
  207.     % Ambient reflection coefficient     %  1.000000
  208.     % Diffuse reflection coefficient    %  0.000000
  209.     % Specular reflection coefficient    %  0.000000
  210.     % Specularity true-color components %  0.000000  0.000000  0.000000
  211.     % Specular exponent                 %  0.000000
  212.     % Transparency coefficient          %  1.000000
  213.    ; 
  214.   Backface_properties
  215.     % Ambient reflection coefficient     %  0.000000
  216.     % Diffuse reflection coefficient    %  0.000000
  217.     % Specular reflection coefficient    %  0.000000
  218.     % Specularity true-color components %  0.000000  0.000000  0.000000
  219.     % Specular exponent                 %  0.000000
  220.     % Transparency coefficient          %  1.000000
  221.    ; 
  222.   Backface_processing
  223.     % Backfacing polygons are identified % 1
  224.     % No backface culling                % 0; 
  225.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  226.   Apply_to_global3  0  ; 
  227.   Call_structure 20  ; 
  228.   
  229.  
  230. % *********************************************************************** % 
  231. %                           Row 2 Column 1                                %
  232. % *********************************************************************** %
  233.   Interior_shading  1; 
  234.   Surface_properties
  235.     % Ambient reflection coefficient     %  0.000000
  236.     % Diffuse reflection coefficient    %  0.000000
  237.     % Specular reflection coefficient    %  0.000000
  238.     % Specularity true-color components %  0.000000  0.000000  0.000000
  239.     % Specular exponent                 %  0.000000
  240.     % Transparency coefficient          %  1.000000
  241.    ; 
  242.   Backface_properties
  243.     % Ambient reflection coefficient     %  1.000000
  244.     % Diffuse reflection coefficient    %  0.000000
  245.     % Specular reflection coefficient    %  0.000000
  246.     % Specularity true-color components %  0.000000  0.000000  0.000000
  247.     % Specular exponent                 %  0.000000
  248.     % Transparency coefficient          %  1.000000
  249.    ; 
  250.   Backface_processing
  251.     % Backfacing polygons not identified % 0
  252.     % Backfacing  poly culled  (ignored) % 1; 
  253.   Pop_matrix3  ; 
  254.   Concat_matrix3  2  0 postconcat  ;         % Move down one row %
  255.   Push_matrix3  ; 
  256.   Apply_to_global3  0  ; 
  257.   Execute_structure 20  ; 
  258.   
  259.  
  260. % *********************************************************************** % 
  261. %                           Row 2 Column 2                                %
  262. % *********************************************************************** %
  263.   Interior_shading  2; 
  264.   Surface_properties
  265.     % Ambient reflection coefficient     %  0.250000
  266.     % Diffuse reflection coefficient    %  0.000000
  267.     % Specular reflection coefficient    %  0.000000
  268.     % Specularity true-color components %  0.000000  0.000000  0.000000
  269.     % Specular exponent                 %  0.000000
  270.     % Transparency coefficient          %  1.000000
  271.    ; 
  272.   Backface_properties
  273.     % Ambient reflection coefficient     %  0.750000
  274.     % Diffuse reflection coefficient    %  0.000000
  275.     % Specular reflection coefficient    %  0.000000
  276.     % Specularity true-color components %  0.000000  0.000000  0.000000
  277.     % Specular exponent                 %  0.000000
  278.     % Transparency coefficient          %  1.000000
  279.    ; 
  280.   Backface_processing
  281.     % Backfacing polygons not identified % 0
  282.     % Frontfacing poly culled  (ignored) % 2; 
  283.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  284.   Apply_to_global3  0  ; 
  285.   Call_structure 20  ; 
  286.   
  287.  
  288. % *********************************************************************** % 
  289. %                           Row 2 Column 3                                %
  290. % *********************************************************************** %
  291.   Interior_shading  3; 
  292.   Surface_properties
  293.     % Ambient reflection coefficient     %  0.750000
  294.     % Diffuse reflection coefficient    %  0.000000
  295.     % Specular reflection coefficient    %  0.000000
  296.     % Specularity true-color components %  0.000000  0.000000  0.000000
  297.     % Specular exponent                 %  0.000000
  298.     % Transparency coefficient          %  1.000000
  299.    ; 
  300.   Backface_properties
  301.     % Ambient reflection coefficient     %  0.250000
  302.     % Diffuse reflection coefficient    %  0.000000
  303.     % Specular reflection coefficient    %  0.000000
  304.     % Specularity true-color components %  0.000000  0.000000  0.000000
  305.     % Specular exponent                 %  0.000000
  306.     % Transparency coefficient          %  1.000000
  307.    ; 
  308.   Backface_processing
  309.     % Backfacing polygons not identified % 0
  310.     % No backface culling                % 0; 
  311.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  312.   Apply_to_global3  0  ; 
  313.   Execute_structure 20  ; 
  314.   
  315.  
  316. % *********************************************************************** % 
  317. %                           Row 2 Column 4                                %
  318. % *********************************************************************** %
  319.   Interior_shading  4; 
  320.   Surface_properties
  321.     % Ambient reflection coefficient     %  1.000000
  322.     % Diffuse reflection coefficient    %  0.000000
  323.     % Specular reflection coefficient    %  0.000000
  324.     % Specularity true-color components %  0.000000  0.000000  0.000000
  325.     % Specular exponent                 %  0.000000
  326.     % Transparency coefficient          %  1.000000
  327.    ; 
  328.   Backface_properties
  329.     % Ambient reflection coefficient     %  0.000000
  330.     % Diffuse reflection coefficient    %  0.000000
  331.     % Specular reflection coefficient    %  0.000000
  332.     % Specularity true-color components %  0.000000  0.000000  0.000000
  333.     % Specular exponent                 %  0.000000
  334.     % Transparency coefficient          %  1.000000
  335.    ; 
  336.   Backface_processing
  337.     % Backfacing polygons not identified % 0
  338.     % Backfacing  poly culled  (ignored) % 1; 
  339.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  340.   Apply_to_global3  0  ; 
  341.   Call_structure 20  ; 
  342.   
  343.  
  344. % *********************************************************************** % 
  345. %                           Row 3 Column 1                                %
  346. % *********************************************************************** %
  347.   Interior_shading  1; 
  348.   Surface_properties
  349.     % Ambient reflection coefficient     %  1.000000
  350.     % Diffuse reflection coefficient    %  0.000000
  351.     % Specular reflection coefficient    %  0.000000
  352.     % Specularity true-color components %  0.000000  0.000000  0.000000
  353.     % Specular exponent                 %  0.000000
  354.     % Transparency coefficient          %  1.000000
  355.    ; 
  356.   Backface_properties
  357.     % Ambient reflection coefficient     %  0.500000
  358.     % Diffuse reflection coefficient    %  0.000000
  359.     % Specular reflection coefficient    %  0.000000
  360.     % Specularity true-color components %  0.000000  0.000000  0.000000
  361.     % Specular exponent                 %  0.000000
  362.     % Transparency coefficient          %  1.000000
  363.    ; 
  364.   Backface_processing
  365.     % Backfacing polygons are identified % 1
  366.     % No backface culling                % 0; 
  367.   Light_state
  368.     activate_list
  369.     {  4    }
  370.     deactivate_list
  371.     {  1    }
  372.    ;
  373.   Pop_matrix3  ; 
  374.   Concat_matrix3  2  0 postconcat  ;         % Move down one row %
  375.   Push_matrix3  ; 
  376.   Apply_to_global3  0  ; 
  377.   Execute_structure 20  ; 
  378.   
  379.  
  380. % *********************************************************************** % 
  381. %                           Row 3 Column 2                                %
  382. % *********************************************************************** %
  383.   Interior_shading  2; 
  384.   Surface_properties
  385.     % Ambient reflection coefficient     %  1.000000
  386.     % Diffuse reflection coefficient    %  0.000000
  387.     % Specular reflection coefficient    %  0.000000
  388.     % Specularity true-color components %  0.000000  0.000000  0.000000
  389.     % Specular exponent                 %  0.000000
  390.     % Transparency coefficient          %  1.000000
  391.    ; 
  392.   Backface_properties
  393.     % Ambient reflection coefficient     %  0.500000
  394.     % Diffuse reflection coefficient    %  0.000000
  395.     % Specular reflection coefficient    %  0.000000
  396.     % Specularity true-color components %  0.000000  0.000000  0.000000
  397.     % Specular exponent                 %  0.000000
  398.     % Transparency coefficient          %  1.000000
  399.    ; 
  400.   Backface_processing
  401.     % Backfacing polygons are identified % 1
  402.     % No backface culling                % 0; 
  403.   Light_state
  404.     activate_list
  405.     {  3    }
  406.     deactivate_list
  407.     {  4    }
  408.    ;
  409.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  410.   Apply_to_global3  0  ; 
  411.   Call_structure 20  ; 
  412.   
  413.  
  414. % *********************************************************************** % 
  415. %                           Row 3 Column 3                                %
  416. % *********************************************************************** %
  417.   Interior_shading  3; 
  418.   Surface_properties
  419.     % Ambient reflection coefficient     %  1.000000
  420.     % Diffuse reflection coefficient    %  0.000000
  421.     % Specular reflection coefficient    %  0.000000
  422.     % Specularity true-color components %  0.000000  0.000000  0.000000
  423.     % Specular exponent                 %  0.000000
  424.     % Transparency coefficient          %  1.000000
  425.    ; 
  426.   Backface_properties
  427.     % Ambient reflection coefficient     %  0.500000
  428.     % Diffuse reflection coefficient    %  0.000000
  429.     % Specular reflection coefficient    %  0.000000
  430.     % Specularity true-color components %  0.000000  0.000000  0.000000
  431.     % Specular exponent                 %  0.000000
  432.     % Transparency coefficient          %  1.000000
  433.    ; 
  434.   Backface_processing
  435.     % Backfacing polygons are identified % 1
  436.     % No backface culling                % 0; 
  437.   Light_state
  438.     activate_list
  439.     {  2    }
  440.     deactivate_list
  441.     {  3    }
  442.    ;
  443.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  444.   Apply_to_global3  0  ; 
  445.   Execute_structure 20  ; 
  446.   
  447.  
  448. % *********************************************************************** % 
  449. %                           Row 3 Column 4                                %
  450. % *********************************************************************** %
  451.   Interior_shading  4; 
  452.   Surface_properties
  453.     % Ambient reflection coefficient     %  1.000000
  454.     % Diffuse reflection coefficient    %  0.000000
  455.     % Specular reflection coefficient    %  0.000000
  456.     % Specularity true-color components %  0.000000  0.000000  0.000000
  457.     % Specular exponent                 %  0.000000
  458.     % Transparency coefficient          %  1.000000
  459.    ; 
  460.   Backface_properties
  461.     % Ambient reflection coefficient     %  0.500000
  462.     % Diffuse reflection coefficient    %  0.000000
  463.     % Specular reflection coefficient    %  0.000000
  464.     % Specularity true-color components %  0.000000  0.000000  0.000000
  465.     % Specular exponent                 %  0.000000
  466.     % Transparency coefficient          %  1.000000
  467.    ; 
  468.   Backface_processing
  469.     % Backfacing polygons are identified % 1
  470.     % No backface culling                % 0; 
  471.   Light_state
  472.     activate_list
  473.     {  1    }
  474.     deactivate_list
  475.     {  2    }
  476.    ;
  477.   Concat_matrix3  1  0 postconcat  ;         % Move over one column %
  478.   Apply_to_global3  0  ; 
  479.   Call_structure 20  ; 
  480.   
  481. End_test  ; 
  482. Sleep 5 ;
  483.