当前位置:网站首页>cesium 旋转图片
cesium 旋转图片
2022-08-10 05:31:00 【怎么吃不饱捏】
功能实现参考了这位大佬:(9条消息) cesium实现动态圆效果之——旋转圆_右弦GISer的博客-CSDN博客_cesium实体旋转
效果如下:
主要代码:
// 添加模型 参数分别为经度,纬度,高度
addPic(longitude, latitude, altitude) {
var entity = viewer.entities.add({
// Cesium.Cartesian3.fromDegrees经纬度转化为世界坐标
position: Cesium.Cartesian3.fromDegrees(longitude, latitude, altitude),
ellipse: {
semiMinorAxis: 1000.0,
semiMajorAxis: 1000.0,
material: Cesium.Color.YELLOW.withAlpha(0.5)
}
});
viewer.zoomTo(viewer.entities);
var ellipse = entity.ellipse;
ellipse.material = new Cesium.ImageMaterialProperty({
//映射到图像
image: require("../assets/logo.png"), //资源地址
color: Cesium.Color.LIGHTCYAN, //背景颜色
repeat: new Cesium.Cartesian2(1, 1) //想x,y方向重复的次数
});
// 旋转效果
this.rotateMaterial(entity.ellipse, 0, 1);
}
/**
* @description: 旋转材质
* @param {*} instance :实体
* @param {*} _stRotation : 初始材质旋转角度
* @param {*} _amount :旋转角度变化量
* @return {*}
*/
rotateMaterial(instance, _stRotation, _amount) {
instance.stRotation = new Cesium.CallbackProperty(function() {
_stRotation += _amount;
if (_stRotation >= 360 || _stRotation <= -360) {
_stRotation = 0;
}
return Cesium.Math.toRadians(_stRotation);
}, false);
},
边栏推荐
- pytorch框架学习(3)torch.nn.functional模块和nn.Module模块
- 基于Qiskit——《量子计算编程实战》读书笔记(三)
- 【Static proxy】
- kaggle小白必看:小白常见的2个错误解决方案
- 【yolov5训练错误】WARNING: Ignoring corrupted image
- PCL点云滤波
- PCL,VS配置过程中出现:用 _sopen_s 代替 _open, 或用_CRT_SECURE_NO_WARNNINGS错误
- Advanced Feature Selection Techniques in Linear Models - Based on R
- AVL树的插入--旋转笔记
- 接口文档进化图鉴,有些古早接口文档工具,你可能都没用过
猜你喜欢
【Static proxy】
基本比例尺标准分幅编号流程
通过一个案例轻松入门OAuth协议
Pony语言学习(六):Struct, Type Alias, Type Expressions
文章复现:超分辨率网络-VDSR
kaggle小白必看:小白常见的2个错误解决方案
scikit-learn机器学习 读书笔记(二)
Jenkins 如何玩转接口自动化测试?
An article will help you understand what is idempotency?How to solve the idempotency problem?
pytorch框架学习(9)torchvision.transform
随机推荐
【论文笔记1】小样本分类
Interface documentation evolution illustration, some ancient interface documentation tools, you may not have used it
行盒子的盒模型
Concurrency tool class - introduction and use of CountDownLatch, CyclicBarrier, Semaphore, Exchanger
清览题库--C语言程序设计第五版编程题解析(1)
OneFlow源码解析:算子指令在虚拟机中的执行
You can‘t specify target table ‘kms_report_reportinfo‘ for update in FROM clause
AWR1843型号毫米波雷达使用
CSDN Markdown 之我见代码块 | CSDN编辑器测评
OAuth2的使用场景、常见误区、使用案例
Pony语言学习(六):Struct, Type Alias, Type Expressions
大咖说·对话生态|当Confluent遇见云:实时流动的数据更有价值
canvas canvas drawing clock
Buu Web
CORS跨域资源共享漏洞的原理与挖掘方法
Pony语言学习(八):引用能力(Reference Capabilities)
【静态代理】
Attention candidates for the soft exam! The detailed registration process for the second half of 2022 is coming!
在yolov5的网络结构中添加注意力机制模块
pytorch框架学习(3)torch.nn.functional模块和nn.Module模块