首页 » cesiumjs » 正文

[cesiumjs]Cesium地球自转的样例代码

分享一下让Cesium地球自转的代码

var i = Date.now();</p>

<p>function rotate() {
    var a = .1;
    var t = Date.now();
    var n = (t - i) / 1e3;
    i = t;
    viewer.scene.camera.rotate(Cesium.Cartesian3.UNIT_Z, -a * n);
}</p>

<p>viewer.clock.onTick.addEventListener(rotate);
setTimeout(function() {
    viewer.clock.onTick.removeEventListener(rotate);
}, 5000);

原文链接:

http://cesiumcn.org/topic/69.html

发表评论