简体   繁体   English

在Three.js中寻找在球面上的两个点之间画线的方法

[英]Looking for a way to draw a line between two points on a sphere in Three.js

My app (a flight tracker) needs to draw a line between two points (cities say) on a sphere (earth) along the surface (ie the great circle route) using Three.js. 我的应用程序(飞行跟踪器)需要使用Three.js在沿着表面(即大圆弧路线)的球体(地球)上的两个点(例如城市)之间绘制一条线。

I can think of 2 ways - (a) creating Three.js 'Line' with a set of (enough) points that I calculate manually and (b) writing the lines into the texture I use for the sphere after it's loaded but before I apply it as a texture. 我可以想到2种方法-(a)使用一组我手动计算的(足够)点创建Three.js'Line',(b)在加载球体之后但在我之前将这些线写入用于球体的纹理中将其应用为纹理。

I can see problems with both (not even sure if (b) is possible in Three.js yet) - anyone think of a better way or have an opinion? 我可以看到两者的问题(甚至不确定在Three.js中是否可以使用(b))-有人在想更好的方法或有意见吗?

Thanks in advance. 提前致谢。

您使用许多粒子来创建一种虚线。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM