当前位置:网站首页>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);
},
边栏推荐
猜你喜欢
随机推荐
【yolov5训练错误】WARNING: Ignoring corrupted image
Conda creates a virtual environment method and pqi uses a domestic mirror source to install a third-party library method tutorial
小记录:Pytorch做深度学习必要加载的包
细数国产接口协作平台的六把武器!
虚拟土地价格暴跌85% 房地产泡沫破裂?依托炒作的暴富游戏需谨慎参与
PCL点云配准--ICP or keypoints+features
非会员更改有道云笔记背景
pytorch框架学习(6)训练一个简单的自己的CNN (三)细节篇
AWR1843型号毫米波雷达使用
手把手带你写嵌入式物联网的第一个项目
Become a language that hackers have to learn. Do you think it's okay after reading it?
Pony语言学习(八):引用能力(Reference Capabilities)
Minio分布式存储系统
MySql之json_extract函数处理json字段
Matlab simulation of multi-factor house price prediction based on BP neural network
OpenGauss source code, is it maintained with VSCode in the window system?
反转链表中的第m至第n个节点---leetcode
文章复现:超分辨率网络FSRCNN
【格式转换】将JPEG图片批量处理为jpg格式
matlab中的常用的类型转换