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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>3D Model attitude control </title>
<link rel="stylesheet" href="/Cesium-1.72/Build/Cesium/Widgets/widgets.css">
<script src="/Cesium-1.72/Build/Cesium/Cesium.js"></script>
</head>
<body>
<div style="width:1500px;height:700px;">
<div id="toolbar" style="z-index: 999;"></div>
<div id="cesiumContainer" style="width:100%;height:100%;"></div>
</div>
</body>
</html>
<script> var viewer = new Cesium.Viewer('cesiumContainer', {
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 }); viewer.scene.globe.enableLighting = true;// Enable the earth with the sun as the light source var heading = Cesium.Math.toRadians(0);// Position of model head y Axis rotation var pitch = 0;//z Axis rotation var roll = 0;//x Axis rotation var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); var orientation = Cesium.Transforms.headingPitchRollQuaternion( Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 5000), hpr ); var entity = new Cesium.Entity({
id:'palne', name:'My plane', position: Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 5000), orientation:orientation, model:{
uri: "/Cesium-1.72/Apps/SampleData/models/CesiumAir/Cesium_Air.glb", minimumPixelSize: 128, maximumScale: 20000, } }) viewer.entities.add(entity); viewer.zoomTo(entity); var imageryLayers = viewer.imageryLayers; // The viewModel tracks the state of our mini application. var viewModel = {
brightness: 0, contrast: 0, hue: 0, saturation: 0, gamma: 0, }; // Convert the viewModel members into knockout observables. Cesium.knockout.track(viewModel); // Bind the viewModel to the DOM elements of the UI that call for it. var toolbar = document.getElementById("toolbar"); Cesium.knockout.applyBindings(viewModel, toolbar); // Make the active imagery layer a subscriber of the viewModel. function subscribeLayerParameter(name) {
Cesium.knockout .getObservable(viewModel, name) .subscribe(function (newValue) {
if (imageryLayers.length > 0) {
var layer = imageryLayers.get(0); layer[name] = newValue; } }); } subscribeLayerParameter("brightness"); subscribeLayerParameter("contrast"); subscribeLayerParameter("hue"); subscribeLayerParameter("saturation"); subscribeLayerParameter("gamma"); </script>
The adjustment of model attitude is related to the current position of the model
Case code :https://github.com/zhangxuhui1992/cesium
边栏推荐
- Simpleitk encountered an ITK only supports orthonormal direction cosines error while reading NII
- 八大基本排序(详解)
- Good partner for cloud skill improvement, senior brother cloud of Amazon officially opened today
- The 25th anniversary of Hong Kong's return to China the Hong Kong Palace Museum officially opened as a new cultural landmark
- The meaning of linetypes enumeration values (line_4, line_8, line_aa) in opencv
- flutter自定义组件
- 【JVM】类加载相关面试题——类加载过程、双亲委派模型
- Property or method “approval1“ is not defined on the instance but referenced during render
- 安全帽佩戴检测算法研究
- 博士毕业去县城工作,如何是你,怎么选?
猜你喜欢

数据库系统概论习题册
![[wechat applet] the hosting environment of the applet](/img/ee/0f1dee4a26eb62c2268484c1b59edf.png)
[wechat applet] the hosting environment of the applet

Mathematical modeling for war preparation 34-bp neural network prediction 2

Wechat emoticons are written into the judgment, and the OK and bomb you send may become "testimony in court"

安全帽佩戴检测算法研究

The meaning of linetypes enumeration values (line_4, line_8, line_aa) in opencv

Required plug-ins for idea
![9: Chapter 3: e-commerce engineering analysis: 4: [general module]; (to be written...)](/img/96/cbed98ec69c952f1d231ce2ed25aab.png)
9: Chapter 3: e-commerce engineering analysis: 4: [general module]; (to be written...)

Exercise book of introduction to database system

面试突击60:什么情况会导致 MySQL 索引失效?
随机推荐
力士乐液控单向阀Z2S10-1-3X/
Mathematical modeling for war preparation 35 time series prediction model
Substrate 跨链技术源码级探索: XCVM的概览
Php7.3 centos7.9 installing sqlserver extensions
Exception class_ Log frame
八大基本排序(详解)
Halcon knowledge: regional topics [07]
NielsenIQ迎来零售实验室负责人Dawn E. Norvell,将加速扩张全球零售战略
geo 读取单细胞csv表达矩阵 单细胞 改列名 seurat
STL tutorial 7-set, pair pair pair group and functor
Several cross end development artifacts
Compile u-boot source code for stm32p157 development board
Rong Lianyun launched rphone based on Tongxin UOS to create a new ecology of localization contact center
Mathematical modeling for war preparation 36 time series model 2
[activity registration] it's your turn to explore the yuan universe! I will be waiting for you in Shenzhen on July 2!
addmodule_ allmerge_ ams_ im
您工厂的MES再不升级,就要被淘汰啦
数据挖掘知识点整理(期末复习版)
OpenCV中LineTypes各枚举值(LINE_4 、LINE_8 、LINE_AA )的含义
JSR303以及常见Validator实现