Cesium.HPUZYZ.Demo icon indicating copy to clipboard operation
Cesium.HPUZYZ.Demo copied to clipboard

对风向图代码有点疑惑

Open xujunpro2 opened this issue 5 years ago • 5 comments

hi,学习了你的代码,收获很多,对Windy.js有几个疑惑,望指点一二: 1。randomParticle方法中的

do { x = Math.floor(Math.random() * (this.windField.cols - 2)); y = Math.floor(Math.random() * (this.windField.rows - 2)); } while (this.windField.getIn(x, y)[2] <= 0 && safe++ < 30); 这个do while循环是否有必要?粒子对象是想获得场网格的row和col的index吧

2。WindField.js的 _calcUV: function (u, v) { return [+u, +v, Math.sqrt(u * u + v * v)]; }, 我理解的u是json数据中的第一组值,v是json数据中的第二组值,这个算法的意义是什么? 望指点!万分感谢!

xujunpro2 avatar Jan 25 '19 05:01 xujunpro2

hi,刚看到一篇关于风场的科普文章,明白了U和V的意义,第二个问题已然明了了:)

xujunpro2 avatar Jan 25 '19 06:01 xujunpro2

hi,另外我移植到cesium1.5.3的时候,发现要做个销毁判断 //释放前一次粒子对象绘制的primitive removeLines: function () { if (this.lines) { _primitives.remove(this.lines); //1.5.3版本 if(!this.lines.isDestroyed()) { this.lines.destroy(); } } },

xujunpro2 avatar Jan 25 '19 07:01 xujunpro2

谢谢对代码bug提醒。 风场的工程是参照其它git工程:https://github.com/kobeCan/cesium-wind 没有深入研究算法。 该工程绘制效率不是很理想,可以通过重写primitive接口实现高效率绘制。

YanzheZhang avatar Feb 25 '19 12:02 YanzheZhang

你好 我参照你的代码 在vue上加载上了风场效果 但是发现流动的效果非常的卡顿 请问 有办法解决这种问题吗

xqwIOS avatar Jul 05 '19 00:07 xqwIOS

刚看见,这个也是我转的仓库,不是我原创。你可以试试在纯生没有vue下是否流畅。看看是不是vue的影响 卓宁 邮箱:[email protected] 签名由 网易邮箱大师 定制 在2019年07月05日 08:40,QingWenXu 写道: 你好 我参照你的代码 在vue上加载上了风场效果 但是发现流动的效果非常的卡顿 请问 有办法解决这种问题吗 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

zhuoning1994 avatar Jul 09 '19 03:07 zhuoning1994