Skip to content
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

Expose API for dynamic javascript control [enhancement] #12

Closed
kzgolden-pba opened this issue Oct 15, 2013 · 4 comments
Closed

Expose API for dynamic javascript control [enhancement] #12

kzgolden-pba opened this issue Oct 15, 2013 · 4 comments

Comments

@kzgolden-pba
Copy link

Hello,

I've been looking at your planetarium for a project I came up with. In my astrophotography website, I want to have RA/DEC info associated with each picture and dynamically change the planetarium as those pictures are selected for view.

When the user selects a picture, I want to display your planetarium centered on the location of the previous picture, and then pan to center on the RA/DEC of the new picture. Sort of an animation kind of thing.

To do this, I need to control the planetarium through code and at the very least, need to be able to give it RA/DEC coordinates as opposed to Alt-Az.

Is there any chance of you exposing API calls to move from the current center to another center via method call instead of mouse drag?

Something like:

planetarium.panTo(RA,DEC,secondsToAnimate);

If that's too much to ask, what about allowing me to supply RA/DEC instead of alt-az at initialization?

@slowe
Copy link
Owner

slowe commented Oct 15, 2013

@kcgolden The basic idea of centring the map on an RA/Dec is great and something I've been wanting to exist for a while for similar reasons to yours. Unfortunately none of the current projections are set up for that; they are either longitude/latitude based or show the whole-sky with the poles fixed to the top/bottom. Many of them also take short-cuts in code/maths (for speed) on the assumption that the horizon stays attached to the bottom of the screen.

I have been working on a more general projection (gnomic tan) for this RA/Dec use-case but I've not been able to get it working correctly. I'm messing something up in my maths as I get reflections of the sky showing up at various positions on the sky.

Animating a pan is another problem. This feature would have to be limited to only work in this one projection. Should it go via the shortest path on the sky (a great circle)? That would probably involve using quaternions (I never quite got my head around them). Perhaps I should treat it like a standard telescope mount and just rotate in RA and Dec separately keeping north upwards. That will have less than ideal behaviour near the poles though.

So, in summary, I'd love to have those features but at the moment I'm a bit stuck on getting them implemented.

@slowe
Copy link
Owner

slowe commented Nov 7, 2013

@kcgolden You may like to know that I think I've sorted out the problem I was having with the gnomic tan projection. I've committed an update to Github but it isn't yet on the live site. I've got a test version at http://strudel.org.uk/virtualsky/?projection=gnomic&gradient=false&ground=false&dec=22.0145&ra=83.6330833&fov=60.

I haven't addressed your suggestion of panning yet.

@slowe
Copy link
Owner

slowe commented Nov 7, 2013

There we go. I've added a function very similar to the one you suggested. The only difference is that you specify the duration of the pan in milliseconds (x1000) as that matches with how other libraries set durations. Angles are provided in decimal degrees. So to pan to the Orion Nebula in 2 seconds use e.g.

planetarium.panTo(83.8220833,-5.3911111,2000);

@slowe slowe closed this as completed Nov 7, 2013
@kzgolden-pba
Copy link
Author

That's really awesome. Thanks for doing that. I can't wait to get a chance
to implement this on my site. I'll let you know when.

On Thu, Nov 7, 2013 at 4:16 PM, Stuart notifications@github.com wrote:

Closed #12 #12.


Reply to this email directly or view it on GitHubhttps://github.com//issues/12
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants