使用 Three.js 进行实时地球仪
我正在我的反应项目中创建一个地球仪,我需要根据给定时间(即现在或将来的某个时间)正确初始化这个地球仪。该地球仪应根据光源(太阳)的昼夜周期正确定位自己。
是否有任何示例或库可以帮助完成此任务?我知道卫星跟踪应用程序已经解决了这个问题,但是,没有很多正确的例子。
I am creating a globe within my react project and I need to correctly initialise this globe based on a given time, (ie, now or sometime in the future). This globe should position itself correctly against a light source's day and night cycle (the sun).
Are there any examples or libraries that can help with this task? I know satellite tracking applications have this problem solved, however, there isn't many correct examples.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
网上有几个例子:
GitHub:在 GitHub 的主页上,你可以看到一个旋转的地球仪,显示最近的公开提交。
后处理:文档中的这个示例可能会帮助您解决太阳光的问题。
至于基于时间的地球仪定位,您可以获取用户当前的时间:
然后利用该信息,您可以相应地调整地球仪和光源(太阳)。
There are a couple examples on the internet:
GitHub: On the home page of GitHub, you can see a globe that rotates and shows recent public commits.
Postprocessing: This example on the docs might help you out with the lighting of the sun.
As for the positioning of the globe based on time, you could grab the users current time:
Then with that information, you can adjust your globe and light source (the sun) accordingly.