yazdmich

Untitled

May 28th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. View.Set ('graphics:720;720,offscreenonly')
  2. const midx := maxx div 2
  3. const midy := maxy div 2
  4. var time_str, title : string
  5. type cart :
  6. record
  7. m : array 0 .. 720, 0 .. 720 of int2
  8. x : array 0 .. 720 of int2
  9. y : array 0 .. 720 of int2
  10. z : array 0 .. 720 of int2
  11. end record
  12. var x, y, z, win1, win2 : int
  13. var map : array 0 .. 720 of cart
  14. function eta(stepnum : int) : string
  15. var eta_ms, eta_m, eta_s : int
  16. var eta_str : string
  17. eta_ms := round(Time.Elapsed / (((stepnum / 720) * 1000) / 10) * (100 - (((stepnum / 720) * 1000) / 10)))
  18. eta_m := round(eta_ms / 1000) div 60
  19. eta_s := round(eta_ms / 1000) mod 60
  20. eta_str := intstr(eta_m)+':'+intstr(eta_s)
  21. result eta_str
  22. end eta
  23. win1 := Window.Open ("position:top;right,graphics:720;720,offscreenonly")
  24. win2 := Window.Open ("position:top;left,graphics:300;300")
  25. for q : 1 .. 720
  26. Window.SetActive(win1)
  27. cls
  28. for s : 0 .. midx
  29. for t : 1 .. midy
  30. map (q).x (t) := round (cosd (s) * t) + midx
  31. map (q).y (t) := round (sind (t) * s) + midy
  32. map (q).z (t) := s
  33. x := map (q).x (t) - midx
  34. z := map (q).z (t)
  35. x := round (cosd (q/2) * x - sind (q/2) * z)
  36. map (q).x (t) := x + midx
  37. Draw.Dot(map(q).x(t), map(q).y(t), (s mod t) mod maxcolour)
  38. end for
  39. end for
  40. View.Update
  41. for i : 0 .. maxx
  42. for o : 0 .. maxy
  43. map(q).m(i,o) := whatdotcolour(i,o)
  44. end for
  45. end for
  46. Window.SetActive(win2)
  47. cls
  48. Draw.FillArc (150, 150, 100, 100, 90, q div 2 + 90, black)
  49. locate (1, 1)
  50. time_str := eta(q)
  51. put round ((q / 720) * 1000) / 10, '%', ' ', time_str
  52. title := (realstr (round ((q / 720) * 1000) / 10, 3) + '% complete, ' + time_str + ' remaining')
  53. View.Set ('title:Rendering: ' + realstr (round ((q / 720) * 1000) / 10, 3) + '%')
  54. View.Update
  55. end for
  56. Window.Close(win2)
  57. cls
  58. View.Update
  59. Input.Pause
  60. loop
  61. for q : 1 .. 720
  62. for s : 0 .. maxx
  63. for t : 0 .. maxy
  64. Draw.Dot (s, t, map(q).m(s,t))
  65. end for
  66. end for
  67. View.Update
  68. end for
  69. cls
  70. Input.Pause
  71. end loop
Advertisement
Add Comment
Please, Sign In to add comment