Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在sphere Three.js上移动纹理_Javascript_Three.js_Webgl - Fatal编程技术网

Javascript 在sphere Three.js上移动纹理

Javascript 在sphere Three.js上移动纹理,javascript,three.js,webgl,Javascript,Three.js,Webgl,我用Three.js制作了一个球体,上面有一张地图,图像尺寸为1024*2048 问题是:我的球体上有圆形几何图形,表示一些感兴趣的地方,但当我只是将图像加载到球体上时,它的位置不好,而且我的兴趣点不在正确的国家之上 我的想法是旋转一点我的地图,使它适合感兴趣的点,但我无法让它工作 我尝试使用texture.offset.x=0.5 Math.PI/(2*Math.PI)=0.5,因为我想旋转半个地球 但最后我只看到了半个地球上的图像 所以我使用了texture.wrapps=THREE.Rep

我用Three.js制作了一个球体,上面有一张地图,图像尺寸为1024*2048

问题是:我的球体上有圆形几何图形,表示一些感兴趣的地方,但当我只是将图像加载到球体上时,它的位置不好,而且我的兴趣点不在正确的国家之上

我的想法是旋转一点我的地图,使它适合感兴趣的点,但我无法让它工作

我尝试使用
texture.offset.x=0.5

Math.PI/(2*Math.PI)=0.5,因为我想旋转半个地球

但最后我只看到了半个地球上的图像

所以我使用了
texture.wrapps=THREE.RepeatWrapping
但是现在我在地球上看到了两张照片,结果很难看

我看了这篇文章想寻求帮助,但它并没有解决我的问题。 顺便问一下,它是强制性的两个形象的权力


有什么想法吗?

使用texture.mapping而不是texture.offset

最后,我使用了球体的phiStart属性:

phiStart-指定水平起始角度。默认值为0

并将其设置为

3/2*Math.PI(而不是0)-(Math.PI/200)以精确匹配国家边界框,如下所示:

图像距离正确位置约100公里,然后简单的数学可以解决这个问题:


2*PI=40.000公里,我想要100公里,所以2*PI*100/40.000=PI/200

谢谢你的回答,我想这是一个很好的建议,但我对此一无所知,你有相关链接我可以看看吗?