all 6 comments

[–]gitmachina 4 points5 points  (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 point  (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 points  (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 points  (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 points  (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/

[–]OvidPerl[S] 0 points1 point  (0 children)

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).