-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Globe animations/GIFs? #3
Comments
I did try to do this with a for loop to make a stop-frame animation but cannot get the for loop to work properly: (Disclaimer: I've never used golang before, so this is the first time I've been playing with it)
|
Very cool @caleuanhopkins! Nothing looks wrong with your code from my perspective. I just learned that the GIF package exists. I assume it would be "easy" ( 🤞 ) to extrapolate your solution to use this library (especially the |
@LOZORD thanks, but there is an issue as the images don't move along the |
This would be a great feature! I'm planning to work on it. As @LOZORD has pointed out the best way is to use the image/gif package. The pinhole package has an example: https://github.com/tidwall/pinhole/blob/86ba04e3523bd03ebff51eac8dd0865c9dc9305e/examples/earth.go The delicate part here is selecting a good color palette. The pinhole example solves this in a very specific way, but we would need a more general solution. Probably just picking the most common colors across the frames would be a decent solution in this case. However after some searching I think there may be a gap in the market for some more sophisticated implementations of the Quantizer interface which can be used for palette selection (see gif.Options). |
@caleuanhopkins the |
@mmcloughlin Thought I might chime in. With the pinhole examples I used Go's builtin image package. But I've since moved to exporting each frame as an individual PNGs and using ffmpeg for creating the gif. This can often lead to much smoother animations, and also provides a utility for generating a palette from an existing frame. This is how I create this cities globe. |
@tidwall I was thinking the same for an animation solution as with each frame they could then be imported into a range slider html element and allow the creation of 3d rotational sliders (this is just a practical example of something I have in my head I can use Globe for). @mmcloughlin thanks for highlighting the bug, I would love to help but I'm brand new to GoLang and I would be useless in helping to debug this one! |
It would be cool to be able save a rotating globe as a GIF (or similar format). This could possibly be done through sewing generated images together (using something like ffmpeg).
The text was updated successfully, but these errors were encountered: