当前位置:网站首页>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
边栏推荐
- ROC-RK3566-PC使用10.1寸IPS触摸屏显示
- OpenCV中LineTypes各枚举值(LINE_4 、LINE_8 、LINE_AA )的含义
- 平面相交与平面方程
- In order to make remote work unaffected, I wrote an internal chat room | community essay
- leetcode:787. K 站中转内最便宜的航班【k步最短路 + dfs记忆化 + defaultdict(dict)】
- Differential analysis between different groups nichenet for silicosis runs successfully!
- On July 2, I invited you to TD Hero online conference
- [JVM] class loading related interview questions - class loading process and parental delegation model
- STL tutorial 7-set, pair pair pair group and functor
- 基于51单片机的计件器设计
猜你喜欢
SSH tool pyqt
On July 2, I invited you to TD Hero online conference
dart:字符串replace相关的方法
【OpenCV 例程200篇】215. 基于多段线绘制近似椭圆
[Verilog basics] summary of some concepts about clock signals (clock setup/hold, clock tree, clock skew, clock latency, clock transition..)
redis淘汰策略
Consolidate entry-C basic variables and constants
leetcode:787. K 站中转内最便宜的航班【k步最短路 + dfs记忆化 + defaultdict(dict)】
[200 opencv routines] 215 Drawing approximate ellipse based on polyline
flutter自定义组件
随机推荐
Raft introduction
聊聊远程办公那些事儿 | 社区征文
Wechat emoticons are written into the judgment, and the OK and bomb you send may become "testimony in court"
Jsr303 and common validator implementations
leetcode:787. K 站中转内最便宜的航班【k步最短路 + dfs记忆化 + defaultdict(dict)】
STL tutorial 7-set, pair pair pair group and functor
In order to make remote work unaffected, I wrote an internal chat room | community essay
平面相交与平面方程
Undistorted resize using pil
AcWing 第 57 场周赛
巩固入门-C#基础变量和常量
addmodule_ allmerge_ ams_ im
[JVM] takes you to learn about the garbage collection mechanism (GC) in the JVM -- including diagrams
OpenCV中LineTypes各枚举值(LINE_4 、LINE_8 、LINE_AA )的含义
坚果云-在新电脑上同步移动硬盘的文件
addmodule_ allmerge_ ams_ im
【OpenCV 例程200篇】215. 基于多段线绘制近似椭圆
安全帽佩戴检测算法研究
Several cross end development artifacts
登录框Tricks