WorldWideTelescope / wwt-web-client

The WorldWide Telescope web client lets you explore the universe in your browser.
https://worldwidetelescope.org/webclient/
MIT License
105 stars 35 forks source link

Changing FOV resets to default sky position #154

Open philrosenfield opened 7 years ago

philrosenfield commented 7 years ago

[Came via email] In http://www.worldwidetelescope.org/Developers/HTML5SDK#WWTWebClientFov there's a sample which controls fov by buttons. However, if you open it http://www.worldwidetelescope.org/docs/Samples/wwtwebclientfovHtml5.html press a button to view Sagittarius, then hit 'Dec fov' the client resets to a default position in the sky before changing zoom level.

thewebkid commented 7 years ago

Script refs in all docs should be changed to worldwidetelescope.org/html5sdk/1.0.1/wwwsdk.min.js. The aspx version is deprecated.

Also, in the new version we use zoom. The getter and setter for raDecZoom is off by a factor of 15 to get/set Right ascension. Jonathan can explain why that is.

This code will zoom in and out

function FovInc() { var newFov = 1.5 * wwt.get_fov(); if (newFov <= 60) { wwt.zoom(1.5); } }

function FovDec() { var newFov = wwt.get_fov() / 1.5; if (wwt.get_fov() >= 0.00022910934437488727) { wwt.zoom(.66666667); } }

However one of the big sore points in our docs is we do not have a system of documenting versions of the sdk and what is new, deprecated, etc.

We need to update all the samples

On Fri, Jun 30, 2017 at 6:26 AM, Phil Rosenfield notifications@github.com wrote:

[Came via email] In http://www.worldwidetelescope.org/Developers/HTML5SDK#WWTWebClientFov there's a sample which controls fov by buttons. However, if you open it http://www.worldwidetelescope.org/docs/Samples/wwtwebclientfovHtml5.html press a button to view Sagittarius, then hit 'Dec fov' the client resets to a default position in the sky before changing zoom level.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WorldWideTelescope/wwt-web-client/issues/154, or mute the thread https://github.com/notifications/unsubscribe-auth/AASfw5BA82UJ7k9mMZjbPYyU5s0AlUW6ks5sJPeRgaJpZM4OKlIx .

RSN-IOP commented 7 years ago

Pretty sure this test code is bugged - if the newFov is equal to or less than 60 (i.e. all the valid ones) you lock the zoom to 1.5. Still, the fix is fairly obvious. Thanks for the update on the script and function call. Does this mean using raDecZoom will end up navigating to the wrong area of the sky?

EDIT: Right, I see. The 1.5 is not a hard value, but the proportional change in zoom level. Can you not use .zoom to go to a specified fov?

RSN-IOP commented 7 years ago

Additional: http://worldwidetelescope.org/html5sdk/1.0.1/wwwsdk.min.js gives a 404.

philrosenfield commented 7 years ago

You want http://worldwidetelescope.org/html5sdk/1.0.1/wwtsdk.min.js note it's wwtsdk not wwwsdk.