波纹环位于地图的背面而不是正面
的前面
我正在尝试使用 Globe,但波纹环总是出现在地图的背面,而不是我正在使用 https://github.com/vasturiano/globe.gl/blob/master/example/random-rings/index.html 作为源 我已经尝试了 BackSide 的波纹环
还有无论如何可以禁用鼠标旋转或禁用鼠标单击或拖动
const N = 2;
const gData = [...Array(N).keys()].map(() => ({
lat: 35.6892,
lng: 51.3890,
maxR: Math.random() * 20 + 10,
propagationSpeed: 2,
repeatPeriod:1000
}));
const colorInterpolator = t => `rgba(255,100,50,${Math.sqrt(1-t)})`;
const world = Globe()
(document.getElementById('globeViz'))
.ringsData(gData)
.ringColor(() => colorInterpolator)
.ringMaxRadius('maxR')
.ringPropagationSpeed('propagationSpeed')
.ringRepeatPeriod('repeatPeriod')
// .backgroundColor('rgba(0,0,0,0)')
.showGlobe(false)
.showAtmosphere(false);
fetch('https://unpkg.com/world-atlas/land-110m.json').then(res => res.json())
.then(landTopo => {
world
.polygonsData(topojson.feature(landTopo, landTopo.objects.land).features)
.polygonCapMaterial(new THREE.MeshLambertMaterial({
color: '#282828',
side: THREE.DoubleSide
}))
.polygonSideColor(() => 'rgba(0,0,0,0)');
});
// Add auto-rotation
world.controls().autoRotate = true;
world.controls().autoRotateSpeed = 0.9;
I'm trying to work with Globe but Ripple rings always going on the backside of the map, not in front of it
I'm using https://github.com/vasturiano/globe.gl/blob/master/example/random-rings/index.html as source
and already I tried BackSide for ripple rings
Also is there anyway to disable rotate with mouse or disable mouseclick or drag
const N = 2;
const gData = [...Array(N).keys()].map(() => ({
lat: 35.6892,
lng: 51.3890,
maxR: Math.random() * 20 + 10,
propagationSpeed: 2,
repeatPeriod:1000
}));
const colorInterpolator = t => `rgba(255,100,50,${Math.sqrt(1-t)})`;
const world = Globe()
(document.getElementById('globeViz'))
.ringsData(gData)
.ringColor(() => colorInterpolator)
.ringMaxRadius('maxR')
.ringPropagationSpeed('propagationSpeed')
.ringRepeatPeriod('repeatPeriod')
// .backgroundColor('rgba(0,0,0,0)')
.showGlobe(false)
.showAtmosphere(false);
fetch('https://unpkg.com/world-atlas/land-110m.json').then(res => res.json())
.then(landTopo => {
world
.polygonsData(topojson.feature(landTopo, landTopo.objects.land).features)
.polygonCapMaterial(new THREE.MeshLambertMaterial({
color: '#282828',
side: THREE.DoubleSide
}))
.polygonSideColor(() => 'rgba(0,0,0,0)');
});
// Add auto-rotation
world.controls().autoRotate = true;
world.controls().autoRotateSpeed = 0.9;
Preview : https://i.ibb.co/JyjwPL7/s.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据文档,默认的
ringAltitude
是0.0015
,而默认的polygonAltitude
为0.01
。如果将ringAltitude 设置为大于polygonAltitude,则环将出现在地形上。运行下面的代码片段以查看其实际效果。According to the documentation, the default
ringAltitude
is0.0015
, whereas the defaultpolygonAltitude
is0.01
. If you set the ringAltitude to be greater than polygonAltitude, the rings will appear over the land shapes. Run the snippet below to see it in action.