|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> |
| 7 | + <meta name="description" content="Draw whole/partial spheres and ellipsoids."> |
| 8 | + <meta name="cesium-sandcastle-labels" content="Geometries"> |
| 9 | + <title>Cesium Demo</title> |
| 10 | + <script type="text/javascript" src="../Sandcastle-header.js"></script> |
| 11 | + <script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script> |
| 12 | + <script type="text/javascript"> |
| 13 | + if(typeof require === 'function') { |
| 14 | + require.config({ |
| 15 | + baseUrl : '../../../Source', |
| 16 | + waitSeconds : 120 |
| 17 | + }); |
| 18 | + } |
| 19 | + </script> |
| 20 | +</head> |
| 21 | +<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html"> |
| 22 | +<style> |
| 23 | + @import url(../templates/bucket.css); |
| 24 | +</style> |
| 25 | +<div id="cesiumContainer" class="fullSize"></div> |
| 26 | +<div id="loadingOverlay"><h1>Loading...</h1></div> |
| 27 | +<div id="toolbar"></div> |
| 28 | +<script id="cesium_sandcastle_script"> |
| 29 | +function startup(Cesium) { |
| 30 | + 'use strict'; |
| 31 | +//Sandcastle_Begin |
| 32 | +var viewer = new Cesium.Viewer('cesiumContainer'); |
| 33 | + |
| 34 | +var saturnPosition = Cesium.Cartesian3.fromDegrees(-95.0, 45.0, 300000.0); |
| 35 | +viewer.entities.add({ |
| 36 | + name : 'Saturn', |
| 37 | + position: saturnPosition, |
| 38 | + ellipsoid : { |
| 39 | + radii : new Cesium.Cartesian3(200000.0, 200000.0, 200000.0), |
| 40 | + material : new Cesium.Color(0.95, 0.82, 0.49) |
| 41 | + } |
| 42 | +}); |
| 43 | + |
| 44 | +viewer.entities.add({ |
| 45 | + name : "Saturn's inner ring", |
| 46 | + position: saturnPosition, |
| 47 | + orientation : Cesium.Transforms.headingPitchRollQuaternion( |
| 48 | + saturnPosition, |
| 49 | + new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(30.0), Cesium.Math.toRadians(30.0), 0.0) |
| 50 | + ), |
| 51 | + ellipsoid : { |
| 52 | + radii : new Cesium.Cartesian3(400000.0, 400000.0, 400000.0), |
| 53 | + innerRadii : new Cesium.Cartesian3(300000.0, 300000.0, 300000.0), |
| 54 | + minimumCone : Cesium.Math.toRadians(89.8), |
| 55 | + maximumCone : Cesium.Math.toRadians(90.2), |
| 56 | + material : new Cesium.Color(0.95, 0.82, 0.49, 0.5) |
| 57 | + } |
| 58 | +}); |
| 59 | + |
| 60 | +viewer.entities.add({ |
| 61 | + name : "Saturn's outer ring", |
| 62 | + position: saturnPosition, |
| 63 | + orientation : Cesium.Transforms.headingPitchRollQuaternion( |
| 64 | + saturnPosition, |
| 65 | + new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(30.0), Cesium.Math.toRadians(30.0), 0.0) |
| 66 | + ), |
| 67 | + ellipsoid : { |
| 68 | + radii : new Cesium.Cartesian3(460000.0, 460000.0, 460000.0), |
| 69 | + innerRadii : new Cesium.Cartesian3(415000.0, 415000.0, 415000.0), |
| 70 | + minimumCone : Cesium.Math.toRadians(89.8), |
| 71 | + maximumCone : Cesium.Math.toRadians(90.2), |
| 72 | + material : new Cesium.Color(0.95, 0.82, 0.49, 0.5) |
| 73 | + } |
| 74 | +}); |
| 75 | + |
| 76 | +viewer.entities.add({ |
| 77 | + name : 'Dome', |
| 78 | + position: Cesium.Cartesian3.fromDegrees(-120.0, 40.0), |
| 79 | + ellipsoid : { |
| 80 | + radii : new Cesium.Cartesian3(200000.0, 200000.0, 200000.0), |
| 81 | + maximumCone : Cesium.Math.PI_OVER_TWO, |
| 82 | + material : Cesium.Color.BLUE.withAlpha(0.3), |
| 83 | + outline : true |
| 84 | + } |
| 85 | +}); |
| 86 | + |
| 87 | +viewer.entities.add({ |
| 88 | + name : 'Dome with inner radius', |
| 89 | + position: Cesium.Cartesian3.fromDegrees(-114.0, 40.0), |
| 90 | + ellipsoid : { |
| 91 | + radii : new Cesium.Cartesian3(250000.0, 200000.0, 150000.0), |
| 92 | + innerRadii : new Cesium.Cartesian3(100000.0, 80000.0, 60000.0), |
| 93 | + maximumCone : Cesium.Math.PI_OVER_TWO, |
| 94 | + material : Cesium.Color.RED.withAlpha(0.3), |
| 95 | + outline : true |
| 96 | + } |
| 97 | +}); |
| 98 | + |
| 99 | +viewer.entities.add({ |
| 100 | + name : 'Dome with top cut out', |
| 101 | + position: Cesium.Cartesian3.fromDegrees(-108.0, 40.0), |
| 102 | + ellipsoid : { |
| 103 | + radii : new Cesium.Cartesian3(200000.0, 200000.0, 200000.0), |
| 104 | + innerRadii : new Cesium.Cartesian3(100000.0, 100000.0, 100000.0), |
| 105 | + minimumCone : Cesium.Math.toRadians(20.0), |
| 106 | + maximumCone : Cesium.Math.PI_OVER_TWO, |
| 107 | + material : Cesium.Color.YELLOW.withAlpha(0.3), |
| 108 | + outline : true |
| 109 | + } |
| 110 | +}); |
| 111 | + |
| 112 | +viewer.entities.add({ |
| 113 | + name : 'Top and bottom cut out', |
| 114 | + position: Cesium.Cartesian3.fromDegrees(-102.0, 40.0, 140000.0), |
| 115 | + ellipsoid : { |
| 116 | + radii : new Cesium.Cartesian3(200000.0, 200000.0, 200000.0), |
| 117 | + innerRadii : new Cesium.Cartesian3(100000.0, 100000.0, 100000.0), |
| 118 | + minimumCone : Cesium.Math.toRadians(60.0), |
| 119 | + maximumCone : Cesium.Math.toRadians(140.0), |
| 120 | + material : Cesium.Color.DARKCYAN.withAlpha(0.3), |
| 121 | + outline : true |
| 122 | + } |
| 123 | +}); |
| 124 | + |
| 125 | +viewer.entities.add({ |
| 126 | + name : 'Bowl', |
| 127 | + position: Cesium.Cartesian3.fromDegrees(-96.0, 39.5, 200000.0), |
| 128 | + ellipsoid : { |
| 129 | + radii : new Cesium.Cartesian3(200000.0, 200000.0, 200000.0), |
| 130 | + innerRadii : new Cesium.Cartesian3(180000.0, 180000.0, 180000.0), |
| 131 | + minimumCone : Cesium.Math.toRadians(110.0), |
| 132 | + material : Cesium.Color.GREEN.withAlpha(0.3), |
| 133 | + outline : true |
| 134 | + } |
| 135 | +}); |
| 136 | + |
| 137 | +viewer.entities.add({ |
| 138 | + name : 'Clock cutout', |
| 139 | + position: Cesium.Cartesian3.fromDegrees(-90.0, 39.0), |
| 140 | + ellipsoid : { |
| 141 | + radii : new Cesium.Cartesian3(200000.0, 200000.0, 200000.0), |
| 142 | + innerRadii : new Cesium.Cartesian3(150000.0, 150000.0, 150000.0), |
| 143 | + minimumClock : Cesium.Math.toRadians(-90.0), |
| 144 | + maximumClock : Cesium.Math.toRadians(180.0), |
| 145 | + minimumCone : Cesium.Math.toRadians(20.0), |
| 146 | + maximumCone : Cesium.Math.toRadians(70.0), |
| 147 | + material : Cesium.Color.BLUE.withAlpha(0.3), |
| 148 | + outline : true |
| 149 | + } |
| 150 | +}); |
| 151 | + |
| 152 | +viewer.entities.add({ |
| 153 | + name : 'Partial dome', |
| 154 | + position: Cesium.Cartesian3.fromDegrees(-84.0, 38.5), |
| 155 | + ellipsoid : { |
| 156 | + radii : new Cesium.Cartesian3(200000.0, 200000.0, 200000.0), |
| 157 | + minimumClock : Cesium.Math.toRadians(-90.0), |
| 158 | + maximumClock : Cesium.Math.toRadians(180.0), |
| 159 | + maximumCone : Cesium.Math.toRadians(90.0), |
| 160 | + material : Cesium.Color.RED.withAlpha(0.3), |
| 161 | + outline : true |
| 162 | + } |
| 163 | +}); |
| 164 | + |
| 165 | +viewer.entities.add({ |
| 166 | + name : 'Wedge', |
| 167 | + position : Cesium.Cartesian3.fromDegrees(-102.0, 35.0, 20000.0), |
| 168 | + orientation : Cesium.Transforms.headingPitchRollQuaternion( |
| 169 | + Cesium.Cartesian3.fromDegrees(-102.0, 35.0, 20000.0), |
| 170 | + new Cesium.HeadingPitchRoll(Cesium.Math.PI / 1.5, 0, 0.0) |
| 171 | + ), |
| 172 | + ellipsoid : { |
| 173 | + radii : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0), |
| 174 | + innerRadii : new Cesium.Cartesian3(10000.0, 10000.0, 10000.0), |
| 175 | + minimumClock : Cesium.Math.toRadians(-15.0), |
| 176 | + maximumClock : Cesium.Math.toRadians(15.0), |
| 177 | + minimumCone : Cesium.Math.toRadians(75.0), |
| 178 | + maximumCone : Cesium.Math.toRadians(105.0), |
| 179 | + material : Cesium.Color.DARKCYAN.withAlpha(0.3), |
| 180 | + outline : true |
| 181 | + } |
| 182 | +}); |
| 183 | +viewer.entities.add({ |
| 184 | + name : 'Partial ellipsoid', |
| 185 | + position : Cesium.Cartesian3.fromDegrees(-95.0, 34.0), |
| 186 | + ellipsoid : { |
| 187 | + radii : new Cesium.Cartesian3(300000.0, 300000.0, 300000.0), |
| 188 | + innerRadii : new Cesium.Cartesian3(70000.0, 70000.0, 70000.0), |
| 189 | + minimumClock : Cesium.Math.toRadians(180.0), |
| 190 | + maximumClock : Cesium.Math.toRadians(400.0), |
| 191 | + maximumCone : Cesium.Math.toRadians(90.0), |
| 192 | + material : Cesium.Color.DARKCYAN.withAlpha(0.3), |
| 193 | + outline : true |
| 194 | + } |
| 195 | +}); |
| 196 | + |
| 197 | +viewer.zoomTo(viewer.entities); |
| 198 | +//Sandcastle_End |
| 199 | + Sandcastle.finishedLoading(); |
| 200 | +} |
| 201 | +if (typeof Cesium !== 'undefined') { |
| 202 | + startup(Cesium); |
| 203 | +} else if (typeof require === 'function') { |
| 204 | + require(['Cesium'], startup); |
| 205 | +} |
| 206 | +</script> |
| 207 | +</body> |
| 208 | +</html> |
0 commit comments