基于纬度/经度旋转球体
好吧,我有一个地球仪 API,我只能通过设置 xyz 轴倾斜来移动它。 (相机无法移动。)我需要能够将纬度/经度映射到它。所以基本上采用 lat/lng 并在 xyz 上旋转并在屏幕中心显示该点。
该设置基本上可以用这张图片来可视化...... http://en.wikipedia.org/wiki/File:ECEF.png
另一件事是,地球在 Z 轴上偏移,使得本初子午线倾斜 0 0 135 度。
谢谢。
Ok so i have an api to a globe that I can only move by setting the x y z axis tilt. (the camera cannot move.) I need to be able to map lat/lng to it. So basically take lat/lng and rotate in x y z and show the point in the center of the screen.
The setup can basically be visualized with this picture...
http://en.wikipedia.org/wiki/File:ECEF.png
One other thing, the globe is offset in Z such that the prime meridian is at 0 0 135 tilt.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以,这对您来说可能有点晚了,但如果您的纬度和经度角度为 Theta(纬度)和 Phi(长),那么以下旋转会将您的点移动到屏幕中心
这里我假设北极点位于 (0,0,1) 即 z=1
首先将 X 轴倾斜设置为 -Theta
然后将 Z 轴倾斜设置为 -Phi
这应该使您的点居中
您可能需要根据球体的构建方式添加偏移量
So, This might be a bit late for your use but if you have your latitude and longitude angles as Theta (lat) and Phi (long) then the following rotation will move your point to the center of the screen
Here I assume that the north pole is at (0,0,1) i.e z=1
First set X axis tilt as -Theta
Then set Z axis tilt as -Phi
This should center your point
You might need to add offsets depending on how the sphere is built