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

Agree on orbiter orientation #22

Open
vorg opened this issue Jan 31, 2019 · 5 comments
Open

Agree on orbiter orientation #22

vorg opened this issue Jan 31, 2019 · 5 comments

Comments

@vorg
Copy link
Member

vorg commented Jan 31, 2019

Currently orbiter is using latlon-to-xyz and xyz-to-latlon to convert spherical coordinates to xyz position. How those 2 relate to each other is matter of convention. The convention assumed in the current implementation assumes that lat:0, lon:0 is point [0, 0, 1] therefore orbiter is located at +X axis looking towards -X axis. This is to make it compatible with lat/lon coordinates of a textured sphere from https://github.com/glo-js/primitive-sphere often used for globe rendering. The problem is that this is agains default OpenGL convention where default camera is positioned +Z axis looking towards -Z axis.

@vorg
Copy link
Member Author

vorg commented Jan 31, 2019

What can we do:

  1. nothing, just add docs and use orbiter.set({ position: [x, y, z] }) for orienting the camera.
  • Problem: expected minLon, maxLon is from e.g. -PI/2, PI/2 but in this case the correct values are -PI, 0
  1. change pex-renderer Orbiter only but adding +-PI/2 to all xyz2latlon transformations
  • Problem: now orbiter lat/lon doesn't match geo position (gps) lat/lon
  1. Add new theta/phi parameters that behave in "WebGL way" (0 deg is +Z)
  • Problem: conflicting set of constrains would be possible if we add minTheta/maxTheta on top of minLon/maxLon

@vorg
Copy link
Member Author

vorg commented Jan 31, 2019

screenshot 2019-01-31 at 14 31 11

Current pex-renderer behaviour. Longitute 0 is on the right +X to make it match longitue 0 on a equirectangular earth texture (given primitive-sphere uv coords)

iu-2

@vorg
Copy link
Member Author

vorg commented Jan 31, 2019

Three JS

screenshot 2019-01-31 at 14 36 11

@vorg
Copy link
Member Author

vorg commented Jan 31, 2019

The conclusion is not to touch lon and lat and introduce theta = lon - 90deg and phi = lat

@dmnsgn
Copy link
Member

dmnsgn commented May 5, 2023

v4: move this to pex-cam

@dmnsgn dmnsgn transferred this issue from pex-gl/pex-renderer May 30, 2024
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

No branches or pull requests

2 participants