10 ms·
Show HN: I rebuilt the Flash app “Scale of the Universe” in WebGL
- amazd 5y agoIncredible... an amazing visualization. I like how you have the mine craft world in there :D
- mattmar96 5y agoThank you! Gotta have minecraft
- dr_dshiv 5y agoNot for phones, I guess.
- mattmar96 5y agoYou can check out the source code here: https://github.com/matttt/scale_of_the_universe https://github.com/matttt/scale_of_the_universe
- xodltus 5y agoThank you for your sharing!
- est 5y agoI wonder how much time did the original version took, and how much time did you spend? I assume Flash version is easier to implement and requires less technical knowledge.
- mattmar96 5y agoNot sure on the original, but I spent about a year working on it on weekends here and there. Hard to find time with full time work and other projects mixed in. I would say it was around 100 hours of work in total. The majority of the was done within a couple weeks but there were a lot of performance tweaks and bugs to fix.
- jancsika 5y agoIs there a way to convert this to an SVG? Just curious what performance would be like to drag and zoom around an SVG version. I'm guessing bad...
- mattmar96 5y agoI had that thought, but the original assets were provided to me in bitmap form. Maybe we can try that in the future though
- jancsika 5y agoAh, ok. Given the style some of the graphics would be fairly easy to convert by hand in Inkscape. But maybe some like the Sloan Great Wall would be more difficult.
- ab_testing 5y agoYou have the HIV virus in there. You should add a coronavirus in there. I don't know how easy or hard that would be?
- mattmar96 5y agoYeah that's a good idea. The only issue is that its been translated into so many different languages that it'd be a pain to get that name/description translated to all 17 of them.
- DarkUranium 5y ago"COVID-19" should be fairly universal, probably?
- DoingIsLearning 5y agoTechnically 'COVID-19' is the disease experienced by humans. The virus is 'SARS-CoV2'.
- ziggus 5y agoWow, that is very cool! Well done!
- mattmar96 5y agoAppreciate it
- chrisweekly 5y agoOn an iPhone 13 Pro / iOS 15.1.1, I get > This version of Scale of the Universe 2 is not designed for phones. Please find the app on the iOS app store. ... but can't find your app on the app store. Any chance you could provide a link?
- mattmar96 5y agoOh hmm. Yeah it looks like the app isn't on the store for me either. I'm not involved in the app but I'll let my collaborator know.
- acdha 5y agoI’d generally recommend not blocking mobile users. I’m not installing an app just to see if I like the idea. An “it’s even better…” pitch after using it would let me know if it’s worth the trouble.
- sprkwd 5y agoYeah. I’m totally not interested now I have to experience it via an app on my phone.
- jlokier 5y agoI get "Please find the app on the iOS app store" and "Download the Scale of the Universe iOS app!" on my Android Samsung Galaxy S8+. I assume there is no app that will run on my phone, and that the web version might work ok if it was allowed, as some other WebGL apps do. (I don't wish to downplay the problems with WebGL or web apps generally across a variety of mobile device though. Maybe there are good reasons for blocking it.)
- pawelwentpawel 5y agoLoving this, really nice work. Works super smooth and even the music is quite nice! A little bit of unrequested feedback: - Allow me to drag the viewport somehow. A couple times I wanted see elements around to position them on my screen in perspective but couldn't do that. - Allow me to stop the zoom out animation somehow. At the moment one move on my trackpad and I teleport from coffee bean to Rwanda. I can't stop this zoom animation. It seems that I have to go to Rwanda. - Support retina screens. This might come in really useful. To do this (it occurs to me that you're using PIXI.js), when creating your app set resolution to window.devicePixelRatio || 1. You might be on a devicePixelRatio === 1 screen and can't see the difference right but trust me it's there. You can test and see it on any modern mac or apple mobile device. Sending you a digital high five of size of the observable universe.
- mattmar96 5y agoThank you for the kind words and feedback! I'll look into these.
- zagrebian 5y agoThe performance is really good. Usually when I open a GPU-intensive visualization in the browser, my laptop fans start making a lot of noise, but not this time.
- mattmar96 5y agoI'm very glad to hear it. I spent a lot of time optimizing.
- miles 5y ago> even the music is quite nice Thanks for mentioning that; the music does not play in Safari, so I opened Firefox in the background for the music while zooming in Safari via trackpad scrolling (which doesn't appear to work in Firefox). The wonderful "Powers of Ten" video has been mentioned elsewhere in the comments; see also "The Simpsons" take: https://www.youtube.com/watch?v=ycvlJ9XMd94 https://www.youtube.com/watch?v=ycvlJ9XMd94 . Lots of fun - thank you, mattmar96!
- bestouff 5y agoOn an android phone this thing wants me to download the iOS app...
- mattmar96 5y agoOh good point. I'll update the message for android.
- sweetsocks21 5y agoI would also note it seems to work very well on Android Firefox in desktop mode.
- pmontra 5y agoIndeed, the message for Android Firefox should be to switch to desktop mode.
- dang 5y agoPast threads about the original (and maybe a few variations): (Edit: this is fun too: https://abcnews.go.com/Technology/page/scale-universe-cary-michael-huang-california-high-school-15573968 https://abcnews.go.com/Technology/page/scale-universe-cary-m...) The Scale of the Universe (2012) - https://news.ycombinator.com/item?id=9629418 https://news.ycombinator.com/item?id=9629418 - May 2015 (8 comments) Scale of the Universe - https://news.ycombinator.com/item?id=7298423 https://news.ycombinator.com/item?id=7298423 - Feb 2014 (80 comments) The Scale of The Universe- Made by 14 year old twins - https://news.ycombinator.com/item?id=4816166 https://news.ycombinator.com/item?id=4816166 - Nov 2012 (1 comment) The Scale of the Universe 2 - https://news.ycombinator.com/item?id=4691798 https://news.ycombinator.com/item?id=4691798 - Oct 2012 (1 comment) The Scale of the Universe - https://news.ycombinator.com/item?id=3589030 https://news.ycombinator.com/item?id=3589030 - Feb 2012 (8 comments) The Scale of the Universe - https://news.ycombinator.com/item?id=3585187 https://news.ycombinator.com/item?id=3585187 - Feb 2012 (2 comments) The scale of the universe, and everything - https://news.ycombinator.com/item?id=2398150 https://news.ycombinator.com/item?id=2398150 - April 2011 (17 comments) Scale of the Universe - https://news.ycombinator.com/item?id=1953919 https://news.ycombinator.com/item?id=1953919 - Nov 2010 (39 comments) Scale of the Universe - https://news.ycombinator.com/item?id=1835460 https://news.ycombinator.com/item?id=1835460 - Oct 2010 (46 comments) Scale of the universe (flash) - https://news.ycombinator.com/item?id=1261816 https://news.ycombinator.com/item?id=1261816 - April 2010 (15 comments)
- mattmar96 5y agoThank you for this. It has been nice to read the old threads. btw, I appreciate you fixing my grammar in the title.
- omoikane 5y agoFor people who like scale comparisons of absurdly large things, there is also: https://www.youtube.com/watch?v=7XbeVosPszo https://www.youtube.com/watch?v=7XbeVosPszo Original: https://www.nicovideo.jp/watch/sm20365493 https://www.nicovideo.jp/watch/sm20365493
- alexvoda 5y ago
- quda 5y agoLove it! Cheers!
- IceWreck 5y agoI like that it mentions minecraft world > earth.
- epicwhaleburger 5y agoLove it! Thanks for sharing, you're doing the science god's work, kid. You'll go far, I'm sure of it.
- thrdbndndn 5y agoIt should be "中文 (繁體)" or "中文 (正體)" for the traditional Chinese, not just "中文". I'm confused a little bit since it has "中文 (简体)" (Chinese (simplified)).
- mattmar96 5y agoThank you, I'll be sure to fix that.
- ChickeNES 5y agoUsing the scroll wheel to zoom doesn't work in Firefox
- mattmar96 5y agoAppreciate the bug report. I’ll take a look.
- ge96 5y agoThese things are always depressing to me regarding meaning. I know the now point is to avoid pain/exist. But the scale and scifi, traveling, will it happen, even then what's the point but yeah. At least I'm busy being poor/trying to escape that at the moment. I do pursue things, have goals, enjoy solving problems/making things but yeah... good reminder. Same for remembering that you are a bag of meat.
- ASalazarMX 5y agoIt's worse falling into the state of mind that no matter what you do, you're insignificant and will be forgotten, and your existence in the cosmic scale means nothing. OTOH, it's liberating, because you know your life is yours to live, it doesn't belong to history, or some nebulous legacy. Enjoy your life, good and bad, because it's the only one you'll ever have. The odds lucking out as a human were slim, as most lives here are microscopic and are not conscious enough to understand living.
- JoeOfTexas 5y agoTake solace in the fact this is a fairly peaceful era. Space while fun to fantasize about, would probably not be as "fun" in reality. Weeks or months of travel between star systems with no internet, not fun. Oh, and we'd definitely make enemies of any alien civilizations.
- ge96 5y agoI was thinking about it, I'd probably bring the entirety of YT to keep me entertained and every media ever produced eg. movies.
- selfhoster11 5y agoHow many terabytes of content do you need not to get bored? My guess is that with some adjustments, it's gonna be just fine. We somehow dealt without and endless box of content at our disposal for centuries, and some of us were even happy.
- krylon 5y agoI love it! Thank you very much!!!
- trilinearnz 5y agoVery cool. I had no idea that the diameter of Jupiter was a mere fraction of the distance of the moon from earth!
- notRobot 5y agoAll planets in the solar system could fit side-by-side between the earth and the moon. Astronomical distances be wild, yo.
- kzrdude 5y agoThe other factoid though, VY Canis Majoris fits inside the orbit of Saturn... that's huge in the other direction. Especially compared with what you said.
- trilinearnz 5y agoWow! I guess you get a little biased when looking at those artistic representations of the solar system from a young age that aren't to scale.
- deleted 5y ago[deleted]
- danaugrs 5y agoNice! Where is the music from? It feels very familiar... isn't it from Kerbal Space Program?
- mattmar96 5y agoYeah it is from KSP, good ear! https://incompetech.com/music/royalty-free/most/kerbalspaceprogram.php https://incompetech.com/music/royalty-free/most/kerbalspacep... Oops I should really add a credit for it.
- aarchi 5y agoWas this a port of the Flash app or reverse engineering it? The description on GitHub mentions that the Flash version was made by your friend, so I presume you have the original source available. I've wanted to port an old Flash game for a long time, but I only have the .swf file, not .fla, because I'm not the original developer. I've tried several decompilers to examine the code and resources, but it would take a lot of work to make sense of the obfuscated code. Unfortunately, it can't be played in the Ruffle emulator since it is written in ActionScript 3, which is not currently supported.
- mattmar96 5y agoIt was closer to a port than reverse engineering. I spoke with Cary (the original creator) to get explanations from him on how the features and math behind it worked. He then sent over the metadata and images for all the objects. I think he sent the original flash project as well but I don't remember reading that code too much because his explanations of the functionality were sufficient.
- modeless 5y agoI didn't realize that the Planck length was so much smaller than the elementary particles. "There's plenty of room at the bottom" indeed.
- grishka 5y agoIt's strange that there's Ukrainian but no Russian.
- andosteinmetz 5y agoFor any who haven't seen it, I also recommend Charles & Ray Eaemes' "Powers of Ten" https://www.youtube.com/watch?v=0fKBhvDjuy0 https://www.youtube.com/watch?v=0fKBhvDjuy0
- lucaaa 5y agoVery nice! You should consider hosting it on it's own domain, something like scaleoftheuniverse.art, .co, .app
- deleted 5y ago[deleted]
- malkia 5y agoCool - just noticed some shimmering when zooming in - is mip-mapping enabled? (This might be a source of slowdown too).
- mattmar96 5y agoInteresting, I’ll take a look at the docs. Appreciate you pointing that out!
- maxtardiveau2 5y agoThe giant green button at the bottom is just slimy -- I fell for it. No, I don't want to install your Protecto extension, whatever the frack it is. Geez.
- faldore 5y agoWhere did that background song come from? It sounds so familiar it just be from a game.
- guerrilla 5y agoWhat does "Total Human Height" being about the diameter of Pollux mean?? Is that a bug?
- zx321 5y agoThe average human height is about 1.5 meters. There are about 7.5 * 10^9 people alive, so the total height of humanity is ~1.1 * 10^10 meters. Wikipedia says that Pollux's radius is about 9 times that of the Sun, which is about 7 * 10^8 meters. So Pollux's diameter is ~2 * 9 * 7 * 10^8 = 1.3 * 10^10 meters. Verdict: not a bug.
- kreelman 5y agoThis is fairly spectacular and a great deal of fun. Puts your daily problems in perspective..... :-)
- superasn 5y agoPretty amazing. I couldn't help but remember this yt video(1) by Carl Sagan while zooming out. (1) https://www.youtube.com/watch?v=wupToqz1e2g https://www.youtube.com/watch?v=wupToqz1e2g
- kzrdude 5y agoNice. Is it possible to contribute to the localizations?
- mattmar96 5y agoAbsolutely. You can email us at scaleoftheuniversedev [at] gmail.com - thanks!
- pmayrgundter 5y agoMy own webgl port of Celestia, which allows zoom-out from Earth to the scale of nearest 10k stars: https://celestiary.github.io/ https://celestiary.github.io/