Skip to content

add azimuthal equidistant projection #34

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add azimuthal equidistant projection #34

wants to merge 2 commits into from

Conversation

d70-t
Copy link
Owner

@d70-t d70-t commented Jun 19, 2025

This PR adds a way to select between different projections. In addition to the current perspective projection, azimuthal equidistant projection is implemented. This is the projection used by the SPHERE spherical display. Similar projections might be applicable to other spherical displays, and we might want to use this method to explore other (map-) projections (e.g. plate-carree, mollweide etc...).

This PR might have some interactions with #33, as the projection argument has to be passed along. I'd be happy adapting this PR after #33 is merged, or we can do it the other way around 🤷

@d70-t d70-t requested a review from Karinon June 19, 2025 12:58
Copy link
Collaborator

@Karinon Karinon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things bother me a bit:

  • zoom is not working anymore
  • The coastlines are still visible as they are on a regular globe. If we don't have a way to distort them aswell, I would probably suggest to disable the coastlines-button, when another projection than perspective is enabled.

@@ -1031,14 +1036,40 @@ void main() {
${distinguishShaders}
}`;

const PI = 3.14159265359;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using Math.PI instead

@d70-t
Copy link
Owner Author

d70-t commented Jun 27, 2025

  • zoom is not working anymore

This was intentional, as the projection was intended to be used with this specific spherical screen. But I see that it's kind of an odd behaviour. I think I'd like to have a mode where we could select projections for specific screens, probably with fixed zoom, but I also see that for other generic map-projections, we'd like to stay zoom-able. Do you have a suggestion of how to represent this UI-wise?

  • The coastlines are still visible as they are on a regular globe. If we don't have a way to distort them aswell, I would probably suggest to disable the coastlines-button, when another projection than perspective is enabled.

Yes... this is an issue. I first didn't do it because of laziness and then forgot about it (but I guess that was the reason why I didn't prepare a PR for the branch for some time). The main issue here is, that we need the custom shader to implement the projections, but the custom shader so far doesn't render line-features. I think the best would be to add line-rendering to our main shader and then use this for the coastlines as well. I'll think a bit more about it, but we probably should delay merging until this is fixed.

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

Successfully merging this pull request may close these issues.

2 participants