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

GUI: play/pause and time sliders #173

Closed
loicspace opened this issue May 16, 2017 · 5 comments
Closed

GUI: play/pause and time sliders #173

loicspace opened this issue May 16, 2017 · 5 comments

Comments

@loicspace
Copy link

Hi,

Within the same context as #172 , I am now trying to add interactivity, essentially, the option to pause/play the animation, and ideally, a play slider to render the window at any user defined time value.
I have looked at the GUI examples and the source code for button.jl and I think the functions/objects I need are playbutton, play_slider
I essentially have a timesignal, e.g. loop(linspace(...)) and some colored surface, particles, lines that are animated/rendered through time signal, of the form:

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

I am not sure however how to use the playbutton or play_slider. I gather that play_v, play_s = playbutton(...) returns both an object to be rendered (play_v) and signal (boolean signal it seems? -- play_s), what I am missing is how to incorporate that with timesignal or elsewhere to effectively pause/play the rendering.

Thanks! and hopefully this makes sense...let me know if not!

Loic

@timholy
Copy link
Contributor

timholy commented May 17, 2017

You might be able to use the player widget in GtkReactive, passing in as an argument the timesignal that GLVisualize sets up. The widget would be in a different window, of course, but as long as you can live with that it might be an easy solution.

@SimonDanisch
Copy link
Member

There was actually a bug in the playslider code -.- Guess that happens if you don't test features.
I updated it and added a usage example:

https://github.com/JuliaGL/GLVisualize.jl/blob/master/examples/gui/playslider.jl

Make sure to be on master of GLVisualize/GLWindow/GLAbstraction/Reactive

Admittedly, the API for placing the resulting visualizable etc is pretty horrible right now...

@loicspace
Copy link
Author

@timholy Thanks for reply! That could work but it seems Simon already jumped on it.

@SimonDanisch Great, thanks! I haven't implemented in my code yet but the example looks exactly like what I want! This is awesome.

I have a couple bigger picture questions, but feel free to close this:

  • at what point -- if any -- GLPlot is more appropriate for interactivity? I've been looking at this one too, and it seems the GUI elements from GLVisualze and GLPlot overlap to some extent. I plan on adding more of that in my simulation and trying to see if I should switched to GLPlot or not, which leads to question 2:
  • does GLPlot include all the rendering GLVisualize is capable of? For instance, I'm using particles with primitives to render spacecraft motion, render the rotating earth with a texture, ...

Thanks again!

@SimonDanisch
Copy link
Member

GLPlot is a superset of GLVisualize! It's supposed to offer a fairly simple UI for easy exploration of the parameters of your visualization and simply add sliders etc... glplot directly maps to visualize, while adding the edit menu ;)

@loicspace
Copy link
Author

OK - that's what I was hoping but wanted to ask more before going through the rabbit whole.
I'll experiment more and build up on it and may ask more later, but if so, I'll go over to the GLPlot repo ;)

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

3 participants