当前位置:网站首页>Cesium-1.72 learning (earth rotation)
Cesium-1.72 learning (earth rotation)
2022-06-30 17:10:00 【Eternal wolf tooth】

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>earth rotation </title>
<link rel="stylesheet" href="/Cesium-1.72/Build/Cesium/Widgets/widgets.css">
<script src="/Cesium-1.72/Build/Cesium/Cesium.js"></script>
</head>
<div style="width:1500px;height:700px;">
<div id="cesiumContainer" style="width:100%;height:100%;"></div>
</div>
</html>
<script> var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider:new Cesium.UrlTemplateImageryProvider({
url:'http://localhost:8099/basemap_0-10/{z}/{y}/{x}.png', // Native map service fileExtension : "png", }), geocoder:false, // A geographic location search tool , Used to display the geographic location accessed by the camera . The default is Microsoft Bing Map . homeButton:true, // Home page location , Click to jump to the default view . sceneModePicker:true, // Switch 2D、3D and Columbus View (CV) Pattern . baseLayerPicker:false, // Select the base map of 3D digital earth (imagery and terrain). navigationHelpButton:true, // Help tips , How to operate digital earth . animation:false,// Control the playback speed of window animation . creditsDisplay:false, // Display trademark copyright and data sources . timeline:false, // Show the current time and allow the user to drag to any specified time on the progress bar . fullscreenButton:true, // Check the full screen button shouldAnimate: true, clock:new Cesium.Clock({
currentTime:Cesium.JulianDate.fromDate(new Date()) }) }); viewer.scene.globe.enableLighting = true;// Enable the earth with the sun as the light source // The earth rotates function icrf() {
if (!viewer || viewer.scene.mode !== Cesium.SceneMode.SCENE3D) {
return; } const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix( viewer.clock.currentTime ); if (Cesium.defined(icrfToFixed)) {
const camera = viewer.camera; const offset = Cesium.Cartesian3.clone(camera.position); const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed); camera.lookAtTransform(transform, offset); } } //option You can set some parameters of the clock , For example, the starting time of rotation , The speed of rotation, etc const start = function (cesiumViewer,option={
multiplier:1}) {
viewer = cesiumViewer viewer.scene.postUpdate.addEventListener(icrf); if(viewer.clock){
const keys=Object.keys(option) for(let k of keys){
viewer.clock[k]=option[k] } } } const stop = function () {
if(!viewer){
return } viewer.clock.multiplier=1 viewer.scene.postUpdate.removeEventListener(icrf); viewer = undefined } // In order to see clearly , Set the clockwise speed to 500 times start(viewer,{
multiplier:500}) setTimeout(function () {
alert(" Stop rotation ") stop(); },10000) </script>
Case code :https://github.com/zhangxuhui1992/cesium
边栏推荐
- 商单视频播放超2000万!农院改造为何屡被催更?
- Dart: string replace related methods
- 阿里云盘分享压缩包
- parker变量柱塞泵PV092R1K1T1NMMC
- Halcon knowledge: matrix topic [02]
- simpleITK读取nii遇到ITK only supports orthonormal direction cosines的错误
- TCP socket and TCP connection
- 泰山OFFICE技术讲座:同一行不同字号的字如何对齐绘制
- Design of piece counter based on 51 single chip microcomputer
- go-micro教程 — 第一章 快速入门
猜你喜欢

More dragon lizard self-developed features! Production available Anolis OS 8.6 officially released

阿里云盘分享压缩包

Mathematical modeling for war preparation 34-bp neural network prediction 2
![[200 opencv routines] 215 Drawing approximate ellipse based on polyline](/img/43/fd4245586071020e5aadb8857316c5.png)
[200 opencv routines] 215 Drawing approximate ellipse based on polyline

Jsr303 and common validator implementations

ssh工具 pyqt
![[JVM] class loading related interview questions - class loading process and parental delegation model](/img/4a/99fee19828b0c1234cc863db88fda1.png)
[JVM] class loading related interview questions - class loading process and parental delegation model

Niuke.com: minimum cost of climbing stairs

AcWing 第 57 场周赛

How to connect the Internet Reading Notes - Summary
随机推荐
【OpenCV 例程200篇】215. 基于多段线绘制近似椭圆
商单视频播放超2000万!农院改造为何屡被催更?
JS Es5 can also create constants?
删除有序数组中的重复项 II[双指针--多情况统一]
Mathematical modeling for war preparation 36 time series model 2
Jspreadsheet/ce JExcel: more data fields than the given fields (columns) will lead to blank columns. Solution
补充材料 supplementary
MySQL8 NDB Cluster安装部署
[wechat applet] the hosting environment of the applet
Substrate 跨链技术源码级探索: XCVM的概览
Raft introduction
HMS core audio editing service 3D audio technology helps create an immersive auditory feast
互联网研发效能实践之去哪儿网(Qunar)核心领域DevOps落地实践
Tutoriel etcd - chapitre 8 API compacte, Watch et lease pour etcd
Halcon knowledge: matrix topic [02]
JSR303以及常见Validator实现
坚果云-在新电脑上同步移动硬盘的文件
您工厂的MES再不升级,就要被淘汰啦
Dart: string replace related methods
Data security compliance has brought new problems to the risk control team