-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHelloworld2.html
346 lines (307 loc) · 40 KB
/
Helloworld2.html
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Use correct character set. -->
<meta charset="utf-8">
<!-- Tell IE to use the latest, best version. -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>Hello World!</title>
<script src="../Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="../Build/Cesium/Widgets/widgets.css">
<!-- 如果要用沙盒里的东西的话加上这个 -->
<script src="../Apps/Sandcastle/Sandcastle-header.js"></script>
<!-- 一定要加上这个css样式 -->
<link rel="stylesheet" href="Sandcastle/templates/bucket.css">
</head>
<body>
<style>
@import url(../templates/bucket.css);
/* height="600px" width="full" */
</style>
<div id="cesiumContainer" class="fullSize"> </div>
<div id="toolbar">
<!-- 这是Demo需要的侧边栏 -->
<table class="infoPanel">
<tbody>
<tr>
<td>Click on the 3D window then use the keyboard to change settings.</td>
</tr>
<tr>
<td>longitude: <span id="longitude_show"></span>°</td>
</tr>
<tr>
<td>latitude: <span id="latitude_show"></span>°</td>
</tr>
<tr>
<td>altitude: <span id="altitude_show"></span>m</td>
</tr>
<tr>
<td>Speed: <span id="speed"></span>m/s</td>
</tr>
<tr>
<td>following man
<input id="fromBehind" type="checkbox">
</td>
</tr>
<button type="button" onclick="displayman()"> 太空人开始漫游</button>
<button type="button" onclick="foucsVX()"> 以卫星视角观看地球</button>
</tbody>
</table>
</div>
<!-- <button type="button" onclick="displayman()"> 太空人开始漫游</button>
<button type="button" onclick="foucsVX()"> 以卫星视角观看地球</button> -->
<script>
Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkODk5YWNlNS1kZjk1LTQzMTctOGRmMy05ZGQ2NTNjMGNhODYiLCJpZCI6OTUwMywic2NvcGVzIjpbImFzciIsImdjIl0sImlhdCI6MTU1NDI1NTU3Mn0.VvgpCpgKnmYhn2ZiABROO2e2bjFERiWBW77i5XnQt4A'
// var Greg= Cesium.JulianDate.toGregorianDate(viewer.clock.currentTime);
// var Iso8601=Cesium.JulianDate.toIso8601(viewer.clock.currentTime,1);
// console.log(Greg);
// console.log(Iso8601);
// (function fn1()
// {position2=Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 6000.0);})
// ();
var viewer = new Cesium.Viewer('cesiumContainer', {
shouldAnimate : true});
viewer.scene.globe.enableLighting = true;
var czml=[{"clock": {"interval": "2019-10-16T07:55:30.075021/2019-10-17T07:55:30.075021", "range": "LOOP_STOP", "currentTime": "2019-10-16T07:55:30.075021", "step": "SYSTEM_CLOCK_MULTIPLIER", "multiplier": 3}, "version": "1.0", "id": "document"},
{"label":
{"font": "11pt Lucida Console", "pixelOffset": {"cartesian2": [12, 0]}, "text": "0 ASTRO E2", "horizontalOrigin": "LEFT", "outlineColor": {"rgba": [0, 0, 0, 255]}, "fillColor": {"rgba": [213, 255, 0, 255]}, "outlineWidth": 2, "show": true},
"id": "Satellite/0 ASTRO E2",
"position": {"referenceFrame": "INERTIAL", "cartesian": [0.0, 6018635.863079319, 2561065.3659869693, -2165830.3096330045, 300.0, 4618754.910360916, 4155695.329017711, -2978516.437232191, 600.0, 2716876.061227325, 5298684.6513891835, -3466599.7811018247, 900.0, 519841.91244124144, 5866066.062817702, -3577056.2552891555, 1200.0, -1733654.5165969497, 5796297.607387084, -3297912.700763176, 1500.0, -3798798.6427074573, 5096839.069971465, -2659506.2727515777, 1800.0, -5451049.015160221, 3843434.0986905685, -1731257.2261556622, 2100.0, -6510521.9612845555, 2172094.070741859, -614235.1921749578, 2400.0, -6861731.969082873, 264466.6689631131, 569786.3384055166, 2700.0, -6466371.723569135, -1671936.5338760715, 1691643.8298705744, 3000.0, -5367552.093192449, -3426465.3017706987, 2628970.8228922416, 3300.0, -3684989.116815524, -4808368.418684478, 3279606.5510295127, 3600.0, -1601791.0788550768, -5667519.307677106, 3572705.9311653306, 3900.0, 655526.9146808351, -5910593.200742718, 3476367.9182871026, 4200.0, 2841568.117189116, -5511090.584120222, 3001049.6256906437, 4500.0, 4718563.224657954, -4512243.622041438, 2198460.218999983, 4800.0, 6082170.747054924, -3022479.200867826, 1156027.7142915376, 5100.0, 6783841.2284136545, -1203779.642730017, -12559.786046578864, 5400.0, 6747195.048657485, 745936.2423198386, -1179778.8062502781, 5700.0, 5976433.942627443, 2614507.177914375, -2218289.842200873, 6000.0, 4555759.637277673, 4198784.499686009, -3014919.059282979, 6300.0, 2639952.2853385615, 5326755.08696723, -3482990.29692444, 6600.0, 437352.93073631916, 5876078.830429698, -3571656.161374237, 6900.0, -1812748.5944180524, 5787161.890984927, -3271308.2429111595, 7200.0, -3865899.390798855, 5069530.115474312, -2614586.021057193, 7500.0, -5498845.775516373, 3800898.0261975694, -1672905.7373079935, 7800.0, -6533793.152982755, 2118938.87997772, -548807.5295819581, 8100.0, -6857924.623402108, 206467.9611214201, 635154.7095199178, 8400.0, -6435890.145069278, -1728469.8038598585, 1749820.8513877175, 8700.0, -5313713.853337959, -3475383.4493566263, 2673610.489898104, 9000.0, -3613654.9035900584, -4844355.966229174, 3305844.025343012, 9300.0, -1520720.6091930743, -5686668.274385844, 3577684.0046654087, 9600.0, 737520.6940845005, -5910822.744539476, 3459544.433274109, 9900.0, 2915570.3961047777, -5492370.126992995, 2964255.363547532, 10200.0, 4776521.236877876, -4476601.335753463, 2145703.7046130598, 10500.0, 6117774.856908001, -2973788.1060605585, 1093062.2781842335, 10800.0, 6793219.748545706, -1147340.2957258625, -78862.09391552868, 11100.0, 6729344.078907484, 803979.5922711722, -1242183.0090503357, 11400.0, 5933323.25173534, 2667842.5003204634, -2269992.491074305, 11700.0, 4492104.941247244, 4241624.946669152, -3050293.126650227, 12000.0, 2562690.072726537, 5354460.848754346, -3498192.3691238374, 12300.0, 354881.8237614225, 5885650.323501702, -3565036.9162893966, 12600.0, -1891470.4092947573, 5777555.117082578, -3243586.055767721, 12900.0, -3932312.4475217513, 5041771.098245627, -2568771.2395559666, 13200.0, -5545714.366273609, 3757981.282927031, -1613980.2725329257, 13500.0, -6555995.720438878, 2065515.0582510792, -483190.12998470006, 13800.0, -6853025.253300937, 148341.4839040612, 700308.013084234, 14100.0, -6404412.72889713, -1784974.9005236176, 1807400.752826297, 14400.0, -5259084.4073354835, -3524121.657113496, 2717336.811665311, 14700.0, -3541820.928313621, -4880030.769457893, 3330951.301646922, 15000.0, -1439495.254851996, -5705406.143380728, 3581438.4383570133, 15300.0, 819307.7779332785, -5910587.07349976, 3441536.961687213, 15600.0, 2989025.846388022, -5473180.814415526, 2926445.918051337, 15900.0, 4833652.625972903, -4440537.259180508, 2092211.3063354727, 16200.0, 6152361.867575696, -2924769.1664362587, 1029721.2488745765, 16500.0, 6801502.577388743, -1090702.1144859327, -145139.25770873006, 16800.0, 6710438.663661526, 862070.3083039653, -1304163.8072217288, 17100.0, 5889314.126861394, 2721070.0639110827, -2320920.807669787, 17400.0, 4427805.623756792, 4284213.784106344, -3084626.3417229913, 17700.0, 2485105.6239228905, 5381799.000834872, -3512200.768935586, 18000.0, 272445.1406216569, 5894777.287314252, -3557200.641509592, 18300.0, -1969803.9404402564, 5767474.246871922, -3214755.6014534086, 18600.0, -3998025.958658316, 5013559.092167428, -2522077.237954794, 18900.0, -5591646.51018058, 3714682.4412653525, -1554501.1835934056, 19200.0, -6577127.269834274, 2011821.316859765, -417405.103498699, 19500.0, -6847036.950236284, 90088.08181863242, 765223.6132980282, 19800.0, -6371947.651606705, -1841450.9446541448, 1864364.0489330497, 20100.0, -5203676.914445973, -3572677.2157208137, 2760134.5405743867, 20400.0, -3469502.6725741946, -4915390.033336641, 3354919.764033473, 20700.0, -1358131.7080297798, -5723729.677680645, 3583967.8469867855, 21000.0, 900871.1545658221, -5909882.90944437, 3422351.640129099, 21300.0, 3061920.9727738383, -5453519.50951191, 2887633.9490925823, 21600.0, 4889946.814249893, -4404049.506084128, 2038001.52641463, 21900.0, 6185926.940583555, -2875420.649467009, 966025.976415993, 22200.0, 6808690.12835588, -1033865.4222464307, -211368.27573505303, 22500.0, 6690484.710669165, 920208.0206221835, -1365700.2829540458, 22800.0, 5844417.744968336, 2774187.530106984, -2371057.113371851, 23100.0, 4362875.94551644, 4326548.534155582, -3117907.0170806334, 23400.0, 2407215.1807186613, 5408766.452953598, -3525010.6612188504, 23700.0, 190060.2871929207, 5903456.257333701, -3548149.9303360176, 24000.0, -2047734.4902338132, 5756915.9151101755, -3184826.4491126784, 24300.0, -4063027.3052631775, 4984891.6705743745, -2474520.0748957144, 24600.0, -5636634.93827864, 3670999.2572271153, -1494488.4469065682, 24900.0, -6597185.368040666, 1957857.3984540575, -351475.254810578, 25200.0, -6839963.072699206, 31707.635014566928, 829879.5777169054, 25500.0, -6338503.789070794, -1897895.932841515, 1920690.9121095326, 25800.0, -5147504.142927662, -3621047.9112058813, 2801989.061649292, 26100.0, -3396715.706460689, -4950430.807433547, 3377741.1739863115, 26400.0, -1276647.5475659121, -5741635.297280981, 3585271.2469186937, 26700.0, 982195.1316420985, -5908706.799797106, 3401994.8299420946, 27000.0, 3134241.3845002856, -5433383.404645083, 2847832.830336725, 27300.0, 4945394.359180593, -4367135.468370514, 1983092.5978152615, 27600.0, 6218465.011375929, -2825741.7610617634, 901998.5464666872, 27900.0, 6814783.284600788, -976829.5761614953, -277526.7982659602, 28200.0, 6669488.6635253895, 978391.2124662856, -1426771.075448561, 28500.0, 5798645.045893242, 2827193.1301623723, -2420384.367794235, 28800.0, 4297330.296319446, 4368626.565070374, -3150123.81293723, 29100.0, 2329035.8782711322, 5435359.644440199, -3536617.526570215, 29400.0, 107743.39080279588, 5911683.747958361, -3537887.707939214, 29700.0, -2125246.352577088, 5745876.904641008, -3153808.826564021, 30000.0, -4127305.096010172, 4955765.798012468, -2426115.653906916, 30300.0, -5680671.9707022915, 3626930.3087998093, -1433962.8014962068, 30600.0, -6616168.242931546, 1903622.1054328785, -285422.8094300429, 30900.0, -6831807.341439847, -26798.831385952635, 894253.4357437671, 31200.0, -6304089.946747691, -1954308.4890888487, 1976362.1419748627, 31500.0, -5090579.034083283, -3669231.380377508, 2842886.072086363, 31800.0, -3323476.4805835513, -4985149.556962917, 3399407.5209011296, 32100.0, -1195059.144819923, -5759119.557876051, 3585348.091702052, 32400.0, 1063262.9255853088, -5907055.257535106, 3380473.4841736834, 32700.0, 3205973.9862106503, -5412769.212650724, 2807055.8982770876, 33000.0, 4999985.238909607, -4329793.221500811, 1927503.5210698708, 33300.0, 6249971.85274008, -2775730.813749843, 837660.5465203149, 33600.0, 6819783.107539954, -919595.0429467831, -343591.8611886859, 33900.0, 6647457.058778297, 1036619.0370820152, -1487355.426601304, 34200.0, 5752007.176180556, 2880084.95507953, -2468885.798370247, 34500.0, 4231183.907004953, 4410444.560412106, -3181265.519653104, 34800.0, 2250583.7453256254, 5461575.300457406, -3547017.371372911, 35100.0, 25511.726408112234, 5919456.05418322, -3526417.404551748, 35400.0, -2202325.146070005, 5734353.658415712, -3121713.041264561, 35700.0, -4190847.200957961, 4926178.965677977, -2376880.633551712, 36000.0, -5723750.916072559, 3582473.3536599176, -1372944.58698068, 36300.0, -6634074.1114917975, 1849115.289630856, -219270.67476037427, 36600.0, -6822573.735335148, -85430.98523051673, 958323.2765079088, 36900.0, -6268715.171718166, -2010687.1071885454, 2031358.7540797004, 37200.0, -5032915.315539783, -3717224.4918474574, 2882811.301218729, 37500.0, -3249800.4709177027, -5019543.178042939, 3419911.401983324, 37800.0, -1113384.04587833, -5776178.618949832, 3584198.247315475, 38100.0, 1144059.0795776576, -5904924.606068555, 3357794.753816254, 38400.0, 3277104.810413734, -5391674.003451875, 2765317.213481906, 38700.0, 5053710.551748235, -4292020.1123502655, 1871253.0012412607, 39000.0, 6280443.04022499, -2725387.0797393173, 773034.2911171888, 39300.0, 6823691.07291552, -862161.5886336013, -409541.00821070094, 39600.0, 6624396.698262112, 1094890.5334671042, -1547432.7395712063, 39900.0, 5704515.988406137, 2932860.264430605, -2516544.564529968, 40200.0, 4164451.186511156, 4451999.766550393, -3211321.5976810423, 40500.0, 2171875.980581919, 5487409.580686531, -3556206.505894735, 40800.0, -56618.72263088425, 5926769.43361182, -3513742.757035148, 41100.0, -2278955.5016048737, 5722342.794960885, -3088550.0736727687, 41400.0, -4253642.707695053, 4896128.04710795, -2326831.4902826087, 41700.0, -5765864.701200406, 3537626.9950860087, -1311454.9013670702, 42000.0, -6650901.751369877, 1794336.116299438, -153041.32075578242, 42300.0, -6812266.51994866, -144188.3941945815, 1022067.2868036339, 42600.0, -6232389.125147153, -2067029.4048720675, 2085661.596546283, 42900.0, -4974526.072752463, -3765024.7947713775, 2921751.1980935745, 43200.0, -3175704.2929946976, -5053607.847597931, 3439245.608220676, 43500.0, -1031638.5706357227, -5792808.758740306, 3581821.9937446574, 43800.0, 1224567.0628685784, -5902311.1610164065, 3333966.3994129323, 44100.0, 3347621.180955653, -5370094.356022122, 2722630.7712879595, 44400.0, 5106560.844780105, -4253814.19706092, 1814360.511112242, 44700.0, 6309874.843852192, -2674709.172614016, 708141.7320362435, 45000.0, 6826508.954872174, -804529.0591212526, -475351.8200003494, 45300.0, 6600314.88565056, 1153203.844545938, -1606982.1568502276, 45600.0, 5656182.883277631, 2985517.098218139, -2563344.5753534646, 45900.0, 4097147.6195374536, 4493288.574115567, -3240281.5818601176, 46200.0, 2092928.6538898128, 5512858.913225822, -3564181.745638178, 46500.0, -138630.83795569537, 5933619.949434147, -3499868.0284522832, 46800.0, -2355123.376222634, 5709840.579682248, -3054330.956144965, 47100.0, -4315679.992050239, 4865610.4694796, -2275985.4603176448, 47400.0, -5807007.059763237, 3492389.2262074007, -1249514.5694295678, 47700.0, -6666650.24325155, 1739283.811540245, -86757.24780526246, 48000.0, -6800890.341558752, -203069.72961450942, 1085463.3018803312, 48300.0, -6195121.225088941, -2123333.858077651, 2139252.278533956, 48600.0, -4915425.381812638, -3812628.8672468127, 2959692.168225111, 48900.0, -3101203.56052203, -5087340.156467656, 3457403.521190818, 49200.0, -949840.2048835979, -5809005.882078114, 3578220.0471197655, 49500.0, 1304771.6786894589, -5899211.033636142, 3308996.352242916, 49800.0, 3417509.5739418543, -5348027.234260715, 2679011.3001060737, 50100.0, 5158527.569240786, -4215172.983256169, 1756845.3415381582, 50400.0, 6338263.83496465, -2623695.7438642415, 643004.9126734664, 50700.0, 6828238.775638267, -746698.1711576825, -541001.4480828757, 51000.0, 6575218.890751981, 1211558.0288670766, -1665983.5763103894, 51300.0, 5607020.13630203, 3038052.4355563945, -2609269.577845231, 51600.0, 4029287.838816776, 4534307.919903043, -3268135.6632847846, 51900.0, 2013759.0004275802, 5537919.180670288, -3570940.235687121, 52200.0, -220508.8053255849, 5940003.611578593, -3484797.762810257, 52500.0, -2430813.760120202, 5696843.481545625, -3019067.4075107975, 52800.0, -4376948.402738373, 4834623.187565816, -2224359.6961715533, 53100.0, -5847172.014716289, 3446758.055233737, -1187144.5709691101, 53400.0, -6681318.777230406, 1683958.42771788, -20441.458332821618, 53700.0, -6788450.0278209625, -262074.60848429328, 1148489.8842515845, 54000.0, -6156921.632662451, -2179597.8165220614, 2192112.1320259566, 54300.0, -4855626.643678001, -3860033.952432113, 2996621.327199804, 54600.0, -3026315.0267324788, -5120735.9928959785, 3474378.7434681207, 54900.0, -868005.1905947406, -5824765.995948111, 3573393.5138263246, 55200.0, 1384656.6741323825, -5895620.354592835, 3282893.170136347, 55500.0, 3486757.489497231, -5325469.217885193, 2634473.5436488898, 55800.0, 5209602.451341947, -4176093.969030114, 1698726.9937300582, 56100.0, 6365606.554987912, -2572346.20211225, 577646.4329474422, 56400.0, 6828882.946146554, -688668.6864258372, -606467.7303538831, 56700.0, 6549116.571029183, 1269950.9846064674, -1724416.5121321403, 57000.0, 5557039.536247745, 3090464.0219704453, -2654304.0630573495, 57300.0, 3960887.5564323906, 4575053.898295785, -3294874.135472254, 57600.0, 1934383.1043465135, 5562586.517164617, -3576479.60517741, 57900.0, -302235.68942987086, 5945916.261254584, -3468537.0506945774, 58200.0, -2506012.6871926286, 5683347.681708135, -2982771.259328877, 58500.0, -4437437.536527768, 4803163.122492379, -2171971.613514443, 58800.0, -5886353.416903668, 3400732.1614385652, -1124366.4887660902, 59100.0, -6694907.130976317, 1628359.082001829, 45883.6675648482, 59400.0, -6774950.827917236, -321201.479113078, 1211125.1115318267, 59700.0, -6117800.230020676, -2235819.47598366, 2244223.249075612, 60000.0, -4795144.258078129, -3907236.3315932862, 3032525.7754199286, 60300.0, -2951054.41648787, -5153791.642373262, 3490165.4501916417, 60600.0, -786150.9256793822, -5840084.757575064, 3567343.959531438, 60900.0, 1464206.838829983, -5891535.0726322215, 3255665.621237012, 61200.0, 3555352.6497167554, -5302416.829833531, 2589032.553808996, 61500.0, 5259776.912814212, -4136575.218473945, 1640025.5989469679, 61800.0, 6391900.317341962, -2520659.061255598, 512088.3436393424, 62100.0, 6828444.119806188, -630441.510780647, -671727.9349176707, 62400.0, 6522015.71411071, 1328381.5152647095, -1782261.2369967022, 62700.0, 5506253.758955088, 3142748.546817969, -2698432.387531377, 63000.0, 3891961.6031372985, 4615523.133329562, -3320487.933417492, 63300.0, 1854818.2099855032, 5586856.532067215, -3580797.838095465, 63600.0, -383795.56662320846, 5951353.6652519135, -3451091.2810727814, 63900.0, -2580706.3758110483, 5669349.281025421, -2945454.6878311518, 64200.0, -4497136.55600658, 4771227.641131991, -2118839.271955455, 64500.0, -5924546.051709936, 3354309.395215922, -1061201.4483570026, 64800.0, -6707415.140067884, 1572485.9842467369, 112195.10389841828, 65100.0, -6760398.137285067, -380449.72814752907, 1273347.79658066, 65400.0, -6077767.658535666, -2291995.9062826866, 2295567.47116846, 65700.0, -4733991.91693956, -3954232.935826081, 3067393.3127644584, 66000.0, -2875438.592577203, -5186502.705643184, 3504758.064554397, 66300.0, -704293.8497586105, -5854957.8621963225, 3560073.3348279097, 66600.0, 1543407.1114574084, -5886951.036682119, 3227322.8489328483, 66900.0, 3623282.230475841, -5278866.907880602, 2542704.02354576, 67200.0, 5309043.452953861, -4096614.0520308455, 1580760.9294730134, 67500.0, 6417142.308954603, -2468633.845878919, 446353.39618162776, 67800.0, 6826925.305172676, -572016.6000874243, -736760.0280911444, 68100.0, 6493924.714491511, 1386847.2602043552, -1839497.6647348772, 68400.0, 5454674.958826557, 3194903.452001041, -2741639.645236511, 68700.0, 3822525.8920575534, 4655711.420641856, -3344968.1223770604, 69000.0, 1775080.6824069193, 5610724.980855451, -3583893.3746581394, 69300.0, -465172.6186495597, 5956311.4705476565, -3432466.235548624, 69600.0, -2654880.3950262754, 5654844.553653874, -2907130.490483496, 69900.0, -4556035.811617271, 4738813.471927738, -2064980.482387709, 70200.0, -5961744.3936758, 3307488.5117574804, -997671.3189725981, 70500.0, -6718843.196851027, 1516338.4117585588, 178470.46261671462, 70800.0, -6744797.795267213, -439817.5651716636, 1335136.289845098, 71100.0, -6036834.2445119005, -2348125.011638212, 2346127.3980465196, 71400.0, -4672184.31800223, -4001019.7445932236, 3101211.7523931935, 71700.0, -2799483.640845111, -5218865.036385743, 3518151.53263565, 72000.0, -622450.3405535386, -5869380.871046434, 3551583.9963226747, 72300.0, 1622241.7001793648, -5881864.12542749, 3197874.585683826, 72600.0, 3690534.6828037226, -5254815.772407938, 2495503.511193733, 72900.0, 5357394.089179444, -4056208.5638942774, 1520953.5211703393, 73200.0, 6441330.461234387, -2416269.185292362, 380463.7734945785, 73500.0, 6824329.777853131, -513395.06617165793, -801541.4262785928, 73800.0, 6464851.860478249, 1445346.754367004, -1896106.4700324817, 74100.0, 5402316.188513688, 3246925.1291516344, -2783910.8235350894, 74400.0, 3752595.679038455, 4695614.906479948, -3368306.3387751896, 74700.0, 1695186.8691921923, 5634187.471211798, -3585765.058681504, 75000.0, -546350.2319550378, 5960785.206016904, -3412668.2337708287, 75300.0, -2728521.637743133, 5639829.389591895, -2867811.4473245773, 75600.0, -4614125.0081447195, 4705917.965675074, -2010413.8231539263, 75900.0, -5997943.828505258, 3260267.434496933, -933797.4905460451, 76200.0, -6729191.778167379, 1459916.7507442962, 244686.72596970116, 76500.0, -6728155.752007949, -499304.1302395742, 1396469.683693691, 76800.0, -5995011.088671145, -2404203.5715939403, 2395885.405935253, 77100.0, -4609735.642351392, -4047593.1777585093, 3133969.5178993056, 77400.0, -2723205.676557145, -5250874.332549669, 3530341.1983147017, 77700.0, -540637.6132374636, -5883349.085550013, 3541878.7803089023, 78000.0, 1700696.1590861436, -5876269.978109084, 3167330.665942122, 78300.0, 3757097.670989007, -5230260.199752248, 2447447.3264103215, 78600.0, 5404821.897463142, -4015356.099205825, 1460623.5263884307, 78900.0, 6464462.606424781, -2363564.739643669, 314442.3470860074, 79200.0, 6820661.134447041, -454577.07666475116, -866050.2545958237, 79500.0, 6434806.065774758, 1503877.3651558948, -1952067.9938313428, 79800.0, 5349190.1327285655, 3298810.488056881, -2825231.5413397425, 80100.0, 3682186.291876307, 4735229.575663902, -3390494.5960028605, 80400.0, 1615153.9772720092, 5657239.212469698, -3586412.1377795804, 80700.0, -627313.1218926338, 5964770.309246713, -3391703.810774871, 81000.0, -2801616.084316294, 5624299.953936292, -2827511.0541637656, 81300.0, -4671395.024358166, 4672537.827065085, -1955157.5977950727, 81600.0, -6033139.459019581, 3212645.0148267397, -869602.0888595942, 81900.0, -6738461.886155653, 1403220.4573464342, 310821.5290803596, 82200.0, -6710478.423120388, -558907.3790106076, 1457326.6314074171, 82500.0, -5952309.088471509, -2460228.946861755, 2444824.509647699, 82800.0, -4546660.18991228, -4093949.491775972, 3165655.384289949, 83100.0, -2646621.675126537, -5282525.767781403, 3541322.730026498, 83400.0, -458871.60113950155, -5896857.869121488, 3530960.8517877497, 83700.0, 1778755.0328083974, -5870164.323639306, 3135701.5893456615, 84000.0, 3822960.125896982, -5205196.438965717, 2398551.6167792315, 84300.0, 5451319.499429785, -3974054.8024069276, 1399791.857422122, 84600.0, 6486537.292761414, -2310519.2736873906, 248311.40151280255, 84900.0, 6815923.262461635, -395563.96679994283, -930264.1086009005, 85200.0, 6403796.205354563, 1562437.0896913281, -2007363.2068802398, 85500.0, 5295309.632917654, 3350556.2775481334, -2865587.731872519, 85800.0, 3611313.8949405043, 4774550.773841168, -3411525.139287257, 86100.0, 1534998.0115323048, 5679875.624623354, -3585834.287850126, 86400.0, -708044.9198354094, 5968262.116138873, -3369580.0958949896, 86700.0, -2874151.0361263575, 5608252.015852284, -2786242.761620155, 87000.0, -4727836.119532014, 4638670.410930665, -1899230.8786197144, 87300.0, -6067327.274944362, 3164619.2695889273, -805106.7388781337, 87600.0, -6746654.633296677, 1346250.1129589328, 376851.89405223343], "interpolationDegree": 5, "epoch": "2019-10-16T07:55:30.075021", "interpolationAlgorithm": "LAGRANGE"}, "description": "Orbit of Satellite: 0 ASTRO E2", "billboard": {"show": true, "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADJSURBVDhPnZHRDcMgEEMZjVEYpaNklIzSEfLfD4qNnXAJSFWfhO7w2Zc0Tf9QG2rXrEzSUeZLOGm47WoH95x3Hl3jEgilvDgsOQUTqsNl68ezEwn1vae6lceSEEYvvWNT/Rxc4CXQNGadho1NXoJ+9iaqc2xi2xbt23PJCDIB6TQjOC6Bho/sDy3fBQT8PrVhibU7yBFcEPaRxOoeTwbwByCOYf9VGp1BYI1BA+EeHhmfzKbBoJEQwn1yzUZtyspIQUha85MpkNIXB7GizqDEECsAAAAASUVORK5CYII=", "scale": 1.5}, "path": {"resolution": 120, "trailTime": [{"interval": "2019-10-16T07:55:30.075021/2019-10-16T08:11:23.879402", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T07:55:30.075021"}, {"interval": "2019-10-16T08:11:23.879402/2019-10-16T09:46:20.292443", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T08:11:23.879402"}, {"interval": "2019-10-16T09:46:20.292443/2019-10-16T11:21:16.705484", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T09:46:20.292443"}, {"interval": "2019-10-16T11:21:16.705484/2019-10-16T12:56:13.118525", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T11:21:16.705484"}, {"interval": "2019-10-16T12:56:13.118525/2019-10-16T14:31:09.531566", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T12:56:13.118525"}, {"interval": "2019-10-16T14:31:09.531566/2019-10-16T16:06:05.944607", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T14:31:09.531566"}, {"interval": "2019-10-16T16:06:05.944607/2019-10-16T17:41:02.357648", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T16:06:05.944607"}, {"interval": "2019-10-16T17:41:02.357648/2019-10-16T19:15:58.770689", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T17:41:02.357648"}, {"interval": "2019-10-16T19:15:58.770689/2019-10-16T20:50:55.183730", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T19:15:58.770689"}, {"interval": "2019-10-16T20:50:55.183730/2019-10-16T22:25:51.596771", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T20:50:55.183730"}, {"interval": "2019-10-16T22:25:51.596771/2019-10-17T00:00:48.009812", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-16T22:25:51.596771"}, {"interval": "2019-10-17T00:00:48.009812/2019-10-17T01:35:44.422853", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-17T00:00:48.009812"}, {"interval": "2019-10-17T01:35:44.422853/2019-10-17T03:10:40.835894", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-17T01:35:44.422853"}, {"interval": "2019-10-17T03:10:40.835894/2019-10-17T04:45:37.248935", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-17T03:10:40.835894"}, {"interval": "2019-10-17T04:45:37.248935/2019-10-17T06:20:33.661976", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-17T04:45:37.248935"}, {"interval": "2019-10-17T06:20:33.661976/2019-10-17T07:55:30.075017", "number": [0, 0, 5696.413041297603, 5696.413041297603], "epoch": "2019-10-17T06:20:33.661976"}], "leadTime": [{"interval": "2019-10-16T07:55:30.075021/2019-10-16T08:11:23.879402", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T07:55:30.075021"}, {"interval": "2019-10-16T08:11:23.879402/2019-10-16T09:46:20.292443", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T08:11:23.879402"}, {"interval": "2019-10-16T09:46:20.292443/2019-10-16T11:21:16.705484", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T09:46:20.292443"}, {"interval": "2019-10-16T11:21:16.705484/2019-10-16T12:56:13.118525", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T11:21:16.705484"}, {"interval": "2019-10-16T12:56:13.118525/2019-10-16T14:31:09.531566", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T12:56:13.118525"}, {"interval": "2019-10-16T14:31:09.531566/2019-10-16T16:06:05.944607", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T14:31:09.531566"}, {"interval": "2019-10-16T16:06:05.944607/2019-10-16T17:41:02.357648", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T16:06:05.944607"}, {"interval": "2019-10-16T17:41:02.357648/2019-10-16T19:15:58.770689", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T17:41:02.357648"}, {"interval": "2019-10-16T19:15:58.770689/2019-10-16T20:50:55.183730", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T19:15:58.770689"}, {"interval": "2019-10-16T20:50:55.183730/2019-10-16T22:25:51.596771", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T20:50:55.183730"}, {"interval": "2019-10-16T22:25:51.596771/2019-10-17T00:00:48.009812", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-16T22:25:51.596771"}, {"interval": "2019-10-17T00:00:48.009812/2019-10-17T01:35:44.422853", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-17T00:00:48.009812"}, {"interval": "2019-10-17T01:35:44.422853/2019-10-17T03:10:40.835894", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-17T01:35:44.422853"}, {"interval": "2019-10-17T03:10:40.835894/2019-10-17T04:45:37.248935", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-17T03:10:40.835894"}, {"interval": "2019-10-17T04:45:37.248935/2019-10-17T06:20:33.661976", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-17T04:45:37.248935"}, {"interval": "2019-10-17T06:20:33.661976/2019-10-17T07:55:30.075017", "number": [0, 5696.413041297603, 5696.413041297603, 0], "epoch": "2019-10-17T06:20:33.661976"}], "material": {"solidColor": {"color": {"rgba": [213, 255, 0, 255]}}}, "show": [{"interval": "2019-10-16T07:55:30.075021/2019-10-17T07:55:30.075021", "boolean": true}], "width": 1}, "availability": "2019-10-16T07:55:30.075021/2019-10-17T07:55:30.075021"}];
var canvas=viewer.scene.canvas;
var vx ;
var position2 = new Cesium.Cartesian3();
var position3 = new Cesium.Cartesian3();
var dataSourcePromise2 = viewer.dataSources.add(Cesium.CzmlDataSource.load(czml));
dataSourcePromise2.then(function(dataSource){
vx = dataSource.entities.getById('Satellite/0 ASTRO E2')});
function foucsVX()
{
viewer.trackedEntity = vx;}
var promise1 = new Promise(function(resolve, reject)
{
(function()
{
viewer.scene.preRender.addEventListener(function(scene, time)
{position2= vx.position.getValue(viewer.clock.currentTime)
// console.log(position2);
resolve(position2);
});
})();
});
promise1.then(function(value) {
position3=position2;
console.log(position3);
});
console.log(position3);
// console.log(position2);
// var cartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(position2);
// var longitude = Cesium.Math.toDegrees(cartographic.longitude).toFixed(3);
// var latitude = Cesium.Math.toDegrees(cartographic.latitude).toFixed(3);
// console.log(latitude);
function displayman()
{
//viewer.scene.preRender.addEventListener(function(scene, time) {console.log(viewer.clock.currentTime)})
// console.log(viewer.clock.currentTime);
// var Iso8601=Cesium.JulianDate.toIso8601(viewer.clock.currentTime,1);
// console.log(Iso8601);
position2= vx.position.getValue(viewer.clock.currentTime)
console.log(position2);
var cartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(position2);
var longitude = Cesium.Math.toDegrees(cartographic.longitude).toFixed(3);
var latitude = Cesium.Math.toDegrees(cartographic.latitude).toFixed(3);
console.log(latitude);
var canvas = viewer.canvas;
canvas.setAttribute('tabindex', '0'); // 将焦点放在画布上
//如果点击就获取画布焦点
canvas.addEventListener('click', function() {
canvas.focus();
});
canvas.focus();
//飞行路径的位置
var pathPosition = new Cesium.SampledPositionProperty();
//添加飞机飞行路径
var entityPath = viewer.entities.add({
position : pathPosition,
name : 'path',
path :
{
show : true,
leadTime : 0,
trailTime : 60,
width : 1000,
resolution : 1,
material : new Cesium.PolylineGlowMaterialProperty
({
glowPower : 0.3,
color : Cesium.Color.PALEGOLDENROD
})
}
});
var scene = viewer.scene;
var camera = viewer.camera;
var controller = scene.screenSpaceCameraController;
var r = 0;
//中心点
var center = new Cesium.Cartesian3();
//机身模型的偏移参数
var hpRoll = new Cesium.HeadingPitchRoll();
//相机模型的偏移参数
var hpRange = new Cesium.HeadingPitchRange();
var speed = 10000;
//默认按一下偏移3度
var deltaRadians = Cesium.Math.toRadians(3.0);
//飞机位置
var position = position2;
//速度向量
var speedVector = new Cesium.Cartesian3();
//生成一个由两个参考系生成的矩阵
var fixedFrameTransform = Cesium.Transforms.localFrameToFixedFrameGenerator('north', 'west');
//添加模型
var planePrimitive = scene.primitives.add(Cesium.Model.fromGltf({
// url : '../Apps/SampleData/models/CesiumAir/Cesium_Air.glb',
url: ' ../Apps/SampleData/models/CesiumMan/Cesium_Man.glb',
modelMatrix : Cesium.Transforms.headingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform),
minimumPixelSize : 128
}));
planePrimitive.readyPromise.then(function(model)
{
// 以半速循环动画
model.activeAnimations.addAll({
speedup : 0.5,
loop : Cesium.ModelAnimationLoop.REPEAT
});
//r=2*max(模型的半径,相机的最近距离)
r = 2.0 * Math.max(model.boundingSphere.radius, camera.frustum.near);
//镜头最近距离
controller.minimumZoomDistance = r * 0.5;
// var cartographic2 = viewer.scene.globe.ellipsoid.cartesianToCartographic( model.boundingSphere.center);
// var longitude2 = Cesium.Math.toDegrees(cartographic2.longitude).toFixed(3);
// var latitude2 = Cesium.Math.toDegrees(cartographic2.latitude).toFixed(3);
// console.log(latitude);
//计算模型center在世界坐标系中的位置(也为下面的镜头跟随提供了center位置)
//但我感觉model.boundingSphere.center就已经是世界坐标了。也不对的这句话
Cesium.Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, center);
// console.log(model.boundingSphere.center)
// console.log( center);
//相机偏移角度
var heading = Cesium.Math.toRadians(230);
var pitch = Cesium.Math.toRadians(-45);
hpRange.heading = hpRoll.heading;
hpRange.pitch = hpRoll.pitch;
// hpRange.heading = heading;
// hpRange.pitch = pitch;
hpRange.range = r * 5000.0;
//固定相机
viewer.trackedEntity =undefined;
camera.lookAt(center, hpRange);
//viewer.trackedEntity = model;
});
//键盘监听
document.addEventListener('keydown', function(e) {
switch (e.keyCode) {
case 40:
if (e.shiftKey) {
// 按住shift加下箭头减速
speed2= speed-100;
speed = Math.max(speed2, 10);
} else {
// 直接按下箭头降低角度
hpRoll.pitch -= deltaRadians;
if (hpRoll.pitch < -Cesium.Math.TWO_PI) {
hpRoll.pitch += Cesium.Math.TWO_PI;
}
}
break;
case 38:
if (e.shiftKey) {
// 按住shift加上箭头加速
speed2= speed+100;
speed = Math.min(speed2, 10000);
} else {
// 直接按上箭头抬高角度
hpRoll.pitch += deltaRadians;
if (hpRoll.pitch > Cesium.Math.TWO_PI) {
hpRoll.pitch -= Cesium.Math.TWO_PI;
}
}
break;
case 39:
if (e.shiftKey) {
// 飞机本身向右旋转
hpRoll.roll += deltaRadians;
if (hpRoll.roll > Cesium.Math.TWO_PI) {
hpRoll.roll -= Cesium.Math.TWO_PI;
}
} else {
// 向右飞行
hpRoll.heading += deltaRadians;
if (hpRoll.heading > Cesium.Math.TWO_PI) {
hpRoll.heading -= Cesium.Math.TWO_PI;
}
}
break;
case 37:
if (e.shiftKey) {
// 飞机本身向左旋转
hpRoll.roll -= deltaRadians;
if (hpRoll.roll < 0.0) {
hpRoll.roll += Cesium.Math.TWO_PI;
}
} else {
// 向左飞行
hpRoll.heading -= deltaRadians;
if (hpRoll.heading < 0.0) {
hpRoll.heading += Cesium.Math.TWO_PI;
}
}
break;
default:
}
});
// var headingSpan = document.getElementById('heading');
// var pitchSpan = document.getElementById('pitch');
// var rollSpan = document.getElementById('roll');
var speedSpan = document.getElementById('speed');
var fromBehind = document.getElementById('fromBehind');
//给左边的通知栏更新数据同时刷新飞机位置(这里也是个1ms一次的回调)
viewer.scene.preRender.addEventListener(function(scene, time) {
var longitude_show = document.getElementById("longitude_show");
var latitude_show = document.getElementById("latitude_show");
var altitude_show = document.getElementById("altitude_show");
var ellipsoid = viewer.scene.globe.ellipsoid;
var cartographic=ellipsoid.cartesianToCartographic(position);
var lat_String = Cesium.Math.toDegrees(cartographic.latitude).toFixed(4);
var log_String = Cesium.Math.toDegrees(cartographic.longitude).toFixed(4);
var alti_String = (cartographic.height).toFixed(2);
longitude_show.innerHTML = log_String;
latitude_show.innerHTML = lat_String;
altitude_show.innerHTML = alti_String;
speedSpan.innerHTML = speed.toFixed(1);
//选择的笛卡尔分量Cartesian3.UNIT_X(x轴单位长度)乘以一个标量speed/10,得到速度向量speedVector
speedVector = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.UNIT_X, speed / 10, speedVector);
//飞机的模型矩阵与速度向量speedVector相乘,在time上的叠加,得到position
position = Cesium.Matrix4.multiplyByPoint(planePrimitive.modelMatrix, speedVector, position);
//添加一个路径模型(就是白色的尾气)
pathPosition.addSample(Cesium.JulianDate.now(), position);
//飞机位置+旋转角度+地球+坐标矩阵=飞机模型矩阵
Cesium.Transforms.headingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform, planePrimitive.modelMatrix);
if (fromBehind.checked)
{ // 镜头跟随
Cesium.Matrix4.multiplyByPoint(planePrimitive.modelMatrix, planePrimitive.boundingSphere.center, center);
hpRange.heading = hpRoll.heading;
hpRange.pitch = hpRoll.pitch;
hpRange.range = 100;
camera.lookAt(center, hpRange);
// viewer.entities.remove(entityPath);
}
});
}
// viewer.extend(Cesium.viewerCesiumInspectorMixin);
// 显示帧速
// viewer.scene.debugShowFramesPerSecond = true;
viewer._cesiumWidget._creditContainer.style.display = "none";
</script>
</body>
</html>