index.html 1.96 KB
Newer Older
Joe TS Dell's avatar
update  
Joe TS Dell committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html lang="en">

<head>
    <meta charset="utf-8">
    <script src="https://cesium.com/downloads/cesiumjs/releases/1.80/Build/Cesium/Cesium.js"></script>
    <link href="https://cesium.com/downloads/cesiumjs/releases/1.80/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
    <link href="./globe.css" rel="stylesheet">
</head>

<body>
    <div id="cesiumContainer" style="width: 100%; height:100%"></div>
    <script>
        var viewer = new Cesium.Viewer('cesiumContainer', {
            baseLayerPicker: false,
            vrButton: false,
            geocoder: false,
            navigationHelpButton: false,
            selectionIndicator: true,
            // shadows: true,
            timeline: false,
            sceneModePicker: false,
            homeButton: false,
            fullscreenButton: false,
            backgroundColor: Cesium.Color.WHITE,
            // infoBox: false,
            // terrainExaggeration: 1.5,
        });

Joe TS Dell's avatar
Joe TS Dell committed
29
        
Joe TS Dell's avatar
update  
Joe TS Dell committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        var scene = viewer.scene;
        var clock = viewer.clock;
        var referenceFramePrimitive;

        var rotatioSpeed;
        var lastNow;
        var spinRate = 0.5;

        viewer.scene.skyBox.destroy();
        viewer.scene.skyBox = undefined;
        viewer.scene.sun.destroy();
        viewer.scene.sun = undefined;
        viewer.scene.skyAtmosphere.destroy();
        viewer.scene.skyAtmosphere = undefined;
        viewer.scene.backgroundColor = new Cesium.Color(255, 255, 255);

        function spinIt(scene, time) {
            var now = Date.now();
Joe TS Dell's avatar
Joe TS Dell committed
48
            var spinRate = 0.01;
Joe TS Dell's avatar
update  
Joe TS Dell committed
49
50
51
52
53
54
55
56
57
58
59
            var delta = (now - lastNow) / 1000;
            lastNow = now;
            viewer.scene.camera.rotate(Cesium.Cartesian3.UNIT_Z, spinRate * delta);
        }

        function spinGlobe(viewer, spin_rate) {
            lastNow = Date.now();
            viewer.scene.postRender.addEventListener(spinIt);
        }
        spinGlobe(viewer);
    </script>
Joe TS Dell's avatar
Joe TS Dell committed
60
    <script src="add_avartar_billboard.js"></script>
Joe TS Dell's avatar
update  
Joe TS Dell committed
61
62
63
</body>

</html>