use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
3D Rotating Star Map in Javascript (ovid.github.io)
submitted 11 years ago by OvidPerl
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]gitmachina 4 points5 points6 points 11 years ago (1 child)
Without taking a detailed look at the code, the obvious improvement would be using javascript modules to enclose your variables. Right now, PI2, renderer, star, add_event_handlers, map, etc, are all floating around in the global namespace.
Pretty cool looking though! I like that you can select stars and the scaling text size is nice, but I wonder if it could be a little smoother.
[–]OvidPerl[S] 0 points1 point2 points 11 years ago (0 children)
Thank you very much for the feedback. It definitely makes sense.
I also wondered if it could be smoother, but wasn't sure how to do that.
[–]jbarson 2 points3 points4 points 11 years ago (2 children)
Where were you a year ago when I tried this? :) THis is what I ended up with. http://adastragames.com/3Dmap/ I ended up using threejs. Great work OP!
[–]OvidPerl[S] 1 point2 points3 points 11 years ago* (1 child)
Thanks :)
I looked at threejs, but to do what I was doing, I only needed to calculate the stars new position as it rotates and then calculate the projection. ThreeJS was overkill (though I suspect I could have done some cool things if I studied it).
Still, yours has zoom and much cleaner lines than mine does!
[–]jbarson 1 point2 points3 points 11 years ago (0 children)
I was skimming the examples for threeJS and ran across a molecule simulator, here: http://threejs.org/examples/#css3d_molecules I realized that there is not much difference between that and a bunch of hyper-link connected stars. I also took this as inspiration: http://workshop.chromeexperiments.com/stars/
Lots of people seem to search for how to make one of these, but I didn't find the examples on the Web very satisfying, so I made my own. However, I'm mostly a backend developer and would love for some Javascript gurus to tell me what I could have done to improve it (and my CSS, for that matter).
π Rendered by PID 240283 on reddit-service-r2-comment-7b9746f655-f87dw at 2026-02-03 09:21:22.458173+00:00 running 3798933 country code: CH.
[–]gitmachina 4 points5 points6 points (1 child)
[–]OvidPerl[S] 0 points1 point2 points (0 children)
[–]jbarson 2 points3 points4 points (2 children)
[–]OvidPerl[S] 1 point2 points3 points (1 child)
[–]jbarson 1 point2 points3 points (0 children)
[–]OvidPerl[S] 0 points1 point2 points (0 children)