This week’s pick comes from two of my colleagues in the UK, Sam and Marta. This is a cool visualization of the Earth and its moon at the proper ratio, but not the proper distance apart. The code is very simple, and one thing I liked about it is how they were able to drape real satellite imagery over the spheres:
This is a nice technique for making visualizations more realistic and appealing.
Also, notice that they added a quick GUI button to the figure window with one command:
u=uicontrol('style', 'togglebutton', 'value', false, 'string', 'Exit');
They then wait for this button to be pressed so that they can close the window:
while ~get(u, 'value')
While they are waiting for the user to click the button, they keep rotating the spheres. You can also see some commented out lines of code that are likely to be of interest to people that want to further modify the code later.
[note: Post updated April 23rd to add link to original code. Oops!]
Comments are closed.
2 CommentsOldest to Newest
I may be dense, but I don’t see the link to the actual code ;-)
With a quick search of the exchange, I found the files here: