fork download
  1. <?php
  2.  
  3. $width = 640;
  4. $height = 480;
  5. $times = [16, 100, 23];
  6.  
  7. $k = 0;
  8. foreach($times as $t){
  9. $k += 1/$t;
  10. }
  11. $k = 1/$k;
  12.  
  13. $percent = 0;
  14. $top = 0;
  15. foreach($times as $t){
  16. $percent += $k/$t;
  17. $bottom = round($percent * $height) - 1;
  18. $h = $bottom - $top + 1;
  19. echo "glScissor(0, $top, $width, $h);\n";
  20. $top = $bottom + 1;
  21. }
  22.  
Success #stdin #stdout 0.02s 23820KB
stdin
Standard input is empty
stdout
glScissor(0, 0, 640, 259);
glScissor(0, 259, 640, 41);
glScissor(0, 300, 640, 180);