Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- View.Set ('graphics:720;720,offscreenonly')
- const midx := maxx div 2
- const midy := maxy div 2
- var time_str, title : string
- type cart :
- record
- m : array 0 .. 720, 0 .. 720 of int2
- x : array 0 .. 720 of int2
- y : array 0 .. 720 of int2
- z : array 0 .. 720 of int2
- end record
- var x, y, z, win1, win2 : int
- var map : array 0 .. 720 of cart
- function eta(stepnum : int) : string
- var eta_ms, eta_m, eta_s : int
- var eta_str : string
- eta_ms := round(Time.Elapsed / (((stepnum / 720) * 1000) / 10) * (100 - (((stepnum / 720) * 1000) / 10)))
- eta_m := round(eta_ms / 1000) div 60
- eta_s := round(eta_ms / 1000) mod 60
- eta_str := intstr(eta_m)+':'+intstr(eta_s)
- result eta_str
- end eta
- win1 := Window.Open ("position:top;right,graphics:720;720,offscreenonly")
- win2 := Window.Open ("position:top;left,graphics:300;300")
- for q : 1 .. 720
- Window.SetActive(win1)
- cls
- for s : 0 .. midx
- for t : 1 .. midy
- map (q).x (t) := round (cosd (s) * t) + midx
- map (q).y (t) := round (sind (t) * s) + midy
- map (q).z (t) := s
- x := map (q).x (t) - midx
- z := map (q).z (t)
- x := round (cosd (q/2) * x - sind (q/2) * z)
- map (q).x (t) := x + midx
- Draw.Dot(map(q).x(t), map(q).y(t), (s mod t) mod maxcolour)
- end for
- end for
- View.Update
- for i : 0 .. maxx
- for o : 0 .. maxy
- map(q).m(i,o) := whatdotcolour(i,o)
- end for
- end for
- Window.SetActive(win2)
- cls
- Draw.FillArc (150, 150, 100, 100, 90, q div 2 + 90, black)
- locate (1, 1)
- time_str := eta(q)
- put round ((q / 720) * 1000) / 10, '%', ' ', time_str
- title := (realstr (round ((q / 720) * 1000) / 10, 3) + '% complete, ' + time_str + ' remaining')
- View.Set ('title:Rendering: ' + realstr (round ((q / 720) * 1000) / 10, 3) + '%')
- View.Update
- end for
- Window.Close(win2)
- cls
- View.Update
- Input.Pause
- loop
- for q : 1 .. 720
- for s : 0 .. maxx
- for t : 0 .. maxy
- Draw.Dot (s, t, map(q).m(s,t))
- end for
- end for
- View.Update
- end for
- cls
- Input.Pause
- end loop
Advertisement
Add Comment
Please, Sign In to add comment