WorldWideTelescope / wwt-webgl-engine

The full WorldWide Telescope rendering engine in JavaScript with WebGL
https://docs.worldwidetelescope.org/webgl-reference/latest/
MIT License
20 stars 10 forks source link

API seems to be restricted to only accept fields of view above 0.001 #184

Open ylvaselling opened 2 years ago

ylvaselling commented 2 years ago

When using the wwt application and passing JSON messages to it with the api, it seems like smaller fovs than 0.001 aren't used. It is possible to scroll in the window and change the field of view smaller however.

Using this message: https://docs.worldwidetelescope.org/webgl-reference/latest/apiref/research-app-messages/interfaces/classicpywwt.centeroncoordinatesmessage.html

pkgw commented 2 years ago

Hi Ylva,

Yes, the way that that message is handled, the FOV/zoom value is clamped:

https://github.com/WorldWideTelescope/wwt-webgl-engine/blob/29305fb9f5ea4bf43e490dcb366ed00f3a04640b/engine/wwtlib/WWTControl.cs#L1971

With a default minimum of about 0.001:

https://github.com/WorldWideTelescope/wwt-webgl-engine/blob/29305fb9f5ea4bf43e490dcb366ed00f3a04640b/engine/wwtlib/WWTControl.cs#L142

It is possible to configure that minimum value in the underlying implementation, but we don't expose that functionality at the JavaScript/TypeScript/messaging level. Would you find it useful to reduce it?

ylvaselling commented 2 years ago

I think it would be useful for some cases where the image has a very small field of view. For example, loading the image 'Antares' gives an unexpected behavior in OpenSpace because the fov animation stops when the image is almost not visible, but it is possible to zoom in further by scrolling.

image