当前位置:网站首页>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
边栏推荐
- 您工厂的MES再不升级,就要被淘汰啦
- Exception class_ Log frame
- CMakeLists 基础
- Multi terminal collaboration of Huawei accounts to create a better internet life
- Alibaba cloud disk sharing compressed package
- Niuke network: longest continuous subarray with positive product
- HMS Core音频编辑服务3D音频技术,助力打造沉浸式听觉盛宴
- The meaning of linetypes enumeration values (line_4, line_8, line_aa) in opencv
- 巩固入门-C#基础变量和常量
- Research on helmet wearing detection algorithm
猜你喜欢

商单视频播放超2000万!农院改造为何屡被催更?

Tutoriel etcd - chapitre 8 API compacte, Watch et lease pour etcd

Property or method “approval1“ is not defined on the instance but referenced during render

阿里云盘分享压缩包

nodejs学习笔记二

Dart: string replace related methods

编译丨迅为iTOP4412开发板Makefile编译

Etcd教程 — 第八章 Etcd之Compact、Watch和Lease API

JSR303以及常见Validator实现

力士乐液控单向阀Z2S10-1-3X/
随机推荐
On July 2, I invited you to TD Hero online conference
pref使用记录
巩固入门-C#基础变量和常量
聊聊遠程辦公那些事兒 | 社區征文
Good partner for cloud skill improvement, senior brother cloud of Amazon officially opened today
A scheduled task deletes data at a specified time
Mathematical modeling for war preparation 35 time series prediction model
IO stream_ recursion
Multi terminal collaboration of Huawei accounts to create a better internet life
登录框Tricks
dart:字符串replace相关的方法
八大基本排序(详解)
List becomes vector list becomes vector list vector
ssh工具 pyqt
山西化工园区智能化管控平台建设时间表
Nut cloud - sync files on your mobile hard drive on your new computer
9:第三章:电商工程分析:4:【通用模块】;(待写……)
【微信小程序】常用组件基本使用(view/scroll-view/swiper、text/rich-text、button/image)
OpenCV中LineTypes各枚举值(LINE_4 、LINE_8 、LINE_AA )的含义
声网自研传输层协议 AUT 的落地实践丨Dev for Dev 专栏