WebGL 线性扫描具体设置?

0 投票
代码如下:

Gloabviewer = new Cesium.Viewer('cesiumContainer');

var initialScanColor = "2263e6";

    Gloabviewer.scene.scanEffect.show = true;

    Gloabviewer.scene.scanEffect.centerPostion = new Cesium.Cartesian3.fromDegrees(121.485457781151,31.240925443989802,3.0);

    Gloabviewer.scene.scanEffect.mode = Cesium.ScanEffectMode.LINE;

    Gloabviewer.scene.scanEffect.color = cesium.Color.fromCssColorString(initialScanColor);

    Gloabviewer.scene.scanEffect.speed = 3;

    var dir = new Cesium.Cartesian3();

    var startPosition = new Cesium.Cartesian3.fromDegrees(121.46995861055099,31.236599929777405,3.0);

    Cesium.Cartesian3.subtract(startPosition, Gloabviewer.scene.scanEffect.centerPostion, dir);

    Gloabviewer.scene.scanEffect.lineMoveDirection = dir;

为什么执行报错?

为An error occurred while rendering.  Rendering has stopped.
12月 19, 2019 分类:  288次浏览 | 用户: Guicong (1 分)

2 个回答

0 投票
viewer.scene.scanEffect.show = true;
var pos = new Cesium.Cartesian3.fromDegrees(refLayer.lon,refLayer.lat,10.0);
viewer.scene.scanEffect.centerPostion = pos;

如果只是简单的扫描线的话,只需要设置这几个条件就可以了
12月 19, 2019 用户: 赵爽 登峰造极 (6,209 分)
0 投票

你好,请问这个报错解决了吗,我也遇到了这个问题,如下图所示:

1月 21, 2020 用户: 君莫笑 初出茅庐 (28 分)
...