Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Controlling speed of loop rendering #172

Open
loicspace opened this issue May 11, 2017 · 2 comments
Open

Controlling speed of loop rendering #172

loicspace opened this issue May 11, 2017 · 2 comments

Comments

@loicspace
Copy link

Hi,

First, that's one great package, I'm having a lot of fun with it!
Now, I'm rendering a surface where the color is a function of time (I'm rendering the ground coverage of a constellation of small satellites over time), which works great. However, the animation is "too fast", and I end up with a bunch of pixels blinking really quickly -- is there a way to explicitly slow down how the loop is rendered?

Thanks!

@SimonDanisch
Copy link
Member

Great to hear :)

Depends a bit on how you structured things!

one way would be like that:

color = Signal(RGBA(0f0, 0f0, 0f0, 1f0)
@async renderloop(window)
while isopen(window)
    push!(color, newcolor)
    yield()
    sleep(0.1)
end

@loicspace
Copy link
Author

Ah, very true.
I essentially have a timesignal, e.g., loop(linspace(something)), and a surface rendered like:

covt = visualize((lon, lat, zeros(lat)),:surface,color=colo, light=light)
_view(covt, window, camera=:perspective)

and colo is of the form:

colo = map(gen_col_inst, timesignal)

where gen_col_inst is a function that determines whether or not a given surface element is covered or not.

P.S. Not time critical issue, I have now added enough bells and whistles in the window that the animation is more than slow enough now ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants