【Cesium解读】Cesium中primitive/entity贴地

官方案例 

Cesium Sandcastle

Cesium Sandcastle

好文推荐:Cesium贴地设置_primitive贴地-CSDN博客

scene.globe.depthTestAgainstTerrain = true;

     True if primitives such as billboards, polylines, labels, etc. should be depth-tested against the terrain surface, or false if such primitives should always be drawn on top of terrain unless they're on the opposite side of the globe. The disadvantage of depth testing primitives against terrain is that slight numerical noise or terrain level-of-detail switched can sometimes make a primitive that should be on the surface disappear underneath it.

    如果广告牌、折线、标签等primitive应该针对地形表面进行深度测试,则为True;如果这些原语应该总是绘制在地形顶部,除非它们位于地球的另一边,则为false。对地形进行深度测试的缺点是,轻微的数值噪声或地形细节水平的切换有时会使应该在表面上的primitive消失在它的下面。

disableDepthTestDistance: Number.POSITIVE_INFINITY,

  Gets or sets the distance from the camera at which to disable the depth test to, for example, prevent clipping against terrain. When set to zero, the depth test is always applied. When set to Number.POSITIVE_INFINITY, the depth test is never applied.

  获取或设置与相机的距离,在该距离上要禁用深度测试,以防止对地形的剪切。当设置为零时,始终应用深度测试。当设置为Number时。POSITIVE_INFINITY,深度测试从未应用。

sampleHeight 

 * Returns the height of scene geometry at the given cartographic position or <code>undefined</code> if there was no
 * scene geometry to sample height from. The height of the input position is ignored. May be used to clamp objects to  the globe, 3D Tiles, or primitives in the scene.

 *
 * This function only samples height from globe tiles and 3D Tiles that are rendered in the current view. Samples heightfrom all other primitives regardless of their visibility.

*这个函数只从当前视图中渲染的全球贴图和3D Tiles中采样高度。从所有其他primitive中采

*样高度,不管它们的可见性如何。

/*** @param {Cartographic} position The cartographic position to sample height from.* @param {Object[]} [objectsToExclude] A list of primitives, entities, or 3D Tiles features to not sample height from.[不被采样高度的]* @param {Number} [width=0.1] Width of the intersection volume in meters.* @returns {Number} The height. This may be <code>undefined</code> if there was no scene geometry to sample height from.-----------------------------------------------------------------------------------------* @example* const position = new Cesium.Cartographic(-1.31968, 0.698874);* const height = viewer.scene.sampleHeight(position);* console.log(height);*
--------------------------------------------------------------------------------------** @exception {DeveloperError} sampleHeight is only supported in 3D mode.* @exception {DeveloperError} sampleHeight requires depth texture support. Check sampleHeightSupported.*/-----------------------------------------------------------------------------------
Scene.prototype.sampleHeight = function (position, objectsToExclude, width) {return this._picking.sampleHeight(this, position, objectsToExclude, width);
};
clampToHeight

 * Clamps the given cartesian position to the scene geometry along the geodetic surface normal. Returns theclamped position or <code>undefined</code> if there was no scene geometry to clamp to. May be used to clamp objects to the globe, 3D Tiles, or primitives in the scene.
 * This function only clamps to globe tiles and 3D Tiles that are rendered in the current view. Clamps to all other primitives regardless of their visibility.
这个函数只固定在当前视图中呈现的globe tiles 和 3D Tiles上。

@Example* // Clamp an entity to the underlying scene geometry* const position = entity.position.getValue(Cesium.JulianDate.now());* entity.position = viewer.scene.clampToHeight(position);------------------------------------------------------------------------------
Scene.prototype.clampToHeight = function (cartesian,objectsToExclude,width,result
) {return this._picking.clampToHeight(this,cartesian,objectsToExclude,width,result);
};
clampToHeightMostDetailed

 * Initiates an asynchronous  query for an array of positions using the maximum level of detail for 3D Tilesets in the scene. The height of the input positions is ignored.Returns a promise that is resolved when the query completes. Each point height is modified in place.

使用场景中3D Tilesets的最大细节级别启动对位置数组异步查询。输入位置的高度被忽略。返回查询完成时解析的promise,每个点的高度都被就地修改。

If a height cannot be determined because no geometry can be sampled at that location, or another error occurs, the height is set to undefined.

 * @example* const positions = [*     new Cesium.Cartographic(-1.31968, 0.69887),*     new Cesium.Cartographic(-1.10489, 0.83923)* ];* const promise = viewer.scene.sampleHeightMostDetailed(positions);* promise.then(function(updatedPosition) {*     // positions[0].height and positions[1].height have been updated.*     // updatedPositions is just a reference to positions.* }-------------------------------------------------------------------------------
Scene.prototype.sampleHeightMostDetailed = function (positions,objectsToExclude,width
) {return this._picking.sampleHeightMostDetailed(this,positions,objectsToExclude,width);
};
sampleHeightMostDetailed

 * Initiates an asynchronous {@link Scene#clampToHeight} query for an array of {@link Cartesian3} positions using the maximum level of detail for 3D Tilesets in the scene. Returns a promise that is resolved whenthe query completes. Each position is modified in place. If a position cannot be clamped because no geometry can be sampled at that location, or another error occurs, the element in the array is set to undefined.

 * @example* const cartesians = [*     entities[0].position.getValue(Cesium.JulianDate.now()),*     entities[1].position.getValue(Cesium.JulianDate.now())* ];* const promise = viewer.scene.clampToHeightMostDetailed(cartesians);* promise.then(function(updatedCartesians) {*     entities[0].position = updatedCartesians[0];*     entities[1].position = updatedCartesians[1];* }---------------------------------------------------------------------------
Scene.prototype.clampToHeightMostDetailed = function (cartesians,objectsToExclude,width
) {return this._picking.clampToHeightMostDetailed(this,cartesians,objectsToExclude,width);
};
HeightReference

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/12337.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

释放系统C盘的ext4.vhdx

ext4.vhdx 是个虚拟磁盘&#xff0c;默认位置为 C:\Users{用户名}\AppData\Local\Docker\wsl\data\ext4.vhdx&#xff0c;会占用很大磁盘空间&#xff0c;可采用下列办法将其改到其它磁盘或分区&#xff0c;如D分区。 1、查看有哪些&#xff1a; # wsl -l -vNAME …

静态代码扫描问题修复之--(输入验证 重定向[NodeJS])

问题描述: 当应用程序直接使用未经验证的用户输入来控制重定向URL时,存在安全隐患。攻击者可借此机会操纵输入,引导用户访问恶意网站,实施网络钓鱼等攻击。这在JavaScript前端代码及Node.js后端逻辑中均需警惕。 案例分析: 应用程序允许未验证的用户输入控制重定向中的UR…

MYSQL主从灾难恢复

方案背景 MySQL一主一从,当主库操作系统宕机无法启动,vip已漂移到从库,原从库成为主库单实例支撑业务。在新建主机上新建MySQL实例,配置为当前vip所在实例的从库,恢复MySQL一主一从。 2 恢复步骤 2.1 新建MySQL实例 2.1.1 解压安装包 #将二进制包上传至/usr/local/然后解…

Android Q - 音频通路调试

对于当前模块不是很清楚&#xff0c;刚好有个项目这方面有点问题&#xff0c;根据展锐支持文档一步步检查就可以了。首先得先弄清楚硬件具体是怎么连接的&#xff0c;比如文档提到的案例&#xff1a;sprd codec speaker output 连接外部 PA。 耳机接的是什么&#xff0c;speake…

C/C++关键字:extern

文章目录 一、extern&#xff1a;声明外部变量或外部函数1.extern的作用2.代码举例①例1②例2③例3 一、extern&#xff1a;声明外部变量或外部函数 1.extern的作用 extern的作用&#xff1a;声明外部的全局变量或外部的函数&#xff0c;以实现跨文件使用其他.c/.h文件的全局…

【Vue】vue项目中使用高德地图教程

在Vue项目中显示高德地图&#xff0c;你需要按照以下步骤进行 1. 注册高德开发者账号并获取API密钥2. 在Vue项目中引入高德地图API3. 在Vue组件中创建地图容器4. 在Vue组件中初始化地图5. 添加其他地图组件&#xff08;可选&#xff09;6. 处理地图事件&#xff08;可选&#x…

[链表专题]力扣82

1. 力扣82 : 删除排序链表中的重复元素 题 : 给定一个已排序的链表的头 head &#xff0c; 删除原始链表中所有重复数字的节点&#xff0c;只留下不同的数字 。返回 已排序的链表 。示例 1&#xff1a;输入&#xff1a;head [1,2,3,3,4,4,5] 输出&#xff1a;[1,2,5] 示例 …

【YOLO改进】换遍MMDET主干网络之Pyramid Vision Transformer(PVT)(基于MMYOLO)

Pyramid Vision Transformer&#xff08;PVT&#xff09; Pyramid Vision Transformer&#xff08;PVT&#xff09;是一种深度学习模型&#xff0c;它结合了Transformer架构和金字塔结构&#xff0c;旨在将Transformer的强大能力引入计算机视觉任务中&#xff0c;特别是那些需…

如何深入理解业务需求和业务流程?

要深入理解业务需求和业务流程&#xff0c;可以尝试以下方法&#xff1a; 1. 积极参与需求讨论&#xff1a;在相关会议中认真聆听&#xff0c;提出问题&#xff0c;与业务人员充分交流。 2. 研读业务文档&#xff1a;仔细分析业务规划、产品说明等文档&#xff0c;梳理出关键…

SQL练习题2.1

建表 # 学生表 create table t_student (stu_id varchar(10),stu_name varchar(10),stu_age datetime,stu_sex varchar(10) );# 课程表 create table t_t_course (c_id varchar(10),c_name varchar(10),c_teaid varchar(10) );# 教师表 create table t_t_teacher (tea…

C语言中数组与指针的区别

一. 简介 本文学习了 C语言中数组与指针的区别。这样的话&#xff0c;可以在编写C代码时规避掉出错的问题。 二. C语言中数组与指针的区别 1. 数组 定义字符串数组时&#xff0c;必须让编译器知道需要多少空间。 一种方法是用足够空间的数组存储字符串。例如如下&#xf…

DOM重点核心(注册事件+DOM事件流)

目录 1.注册事件 注册时间概述 addEventListener() 删除事件 2.DOM事件流 DOM事件流理论 事件对象 事件对象的常见属性和方法 e.targe 和 this的区别 阻止默认行为 阻止冒泡 事件委托 禁止右键菜单和禁止选中文字 获得鼠标的坐标&#xff08;可视区、页面、浏览器…

js原生弹框多选框

js原生弹框多选框 代码如下&#xff1a; <!DOCTYPE html> <html lang"en"> <head> <meta charset"UTF-8"> <meta name"viewport" content"widthdevice-width, initial-scale1.0"> <title>JavaS…

golang适配国产数据库

随着国产化的推进&#xff0c;越来越多的企业选择国产数据库替代mysql或者Oracle。 本篇主要介绍golang如何适配国产数据库 主流的国产数据库有达梦&#xff0c;金仓&#xff0c;神通&#xff0c;优炫&#xff0c;南大通用数据库等 前提环境 unixODBC安装 yum -y install un…

【深度学习实战(36)】模型转换之onnx模型转地平线J3 二进制bin模型

一、PTQ量化流程 &#xff08;1&#xff09; 核查onnx模型 &#xff08;2&#xff09;准备和生成模型校准数据集 &#xff08;3&#xff09;PTQ量化 &#xff08;4&#xff09;量化模型推理 二、具体流程 &#xff08;1&#xff09;使用01_check_onnx.sh脚本&#xff0c;对o…

Spring6 源码分析-ioc

&#xff08;1&#xff09;IDEA开发工具&#xff1a;2022.1.2 &#xff08;2&#xff09;JDK&#xff1a;Java17&#xff08;Spring6要求JDK最低版本是Java17&#xff09; &#xff08;3&#xff09;Spring&#xff1a;6.0.2 <dependencies><!--spring context依赖…

【教程】Linux/Jetson 安装X11VNC同步屏幕内容

转载请注明出处&#xff1a;小锋学长生活大爆炸[xfxuezhagn.cn] 如果本文帮助到了你&#xff0c;请不吝给个[点赞、收藏、关注]哦~ 目录 背景说明 实际效果 安装步骤 安装 x11vnc 配置 x11vnc 配置 x11vnc 作为系统服务 使用 VNC 客户端连接 背景说明 通常vnc-server是单…

分享一个非常好用的安装包下载网站

当我们需要下载linux下的某些包,以便在自己的环境下进行编译自己的安装包的时候,可能需要用到一些各种版本的依赖包,从网上 百度会很麻烦。 这里分享一个很好用的安装包下载网站,记得点赞收藏 网站: Red Hat Enterprise Linux Repositories - pkgs.org 找到对应系统,然…

深入理解K8S【安全认证机制kubectlconfig】

深入理解K8S【安全认证机制】 1 核心概念 1.1 安全体系 对于大型系统来说&#xff0c;对业务的权限、网络的安全认证是必不可少的。 对于linux系统来说&#xff0c;用户和组、文件权限、SELinux、防火墙、pam、sudo等&#xff0c;究其核心的目的都是为了保证系统是安全的。 …

golang 中在for循环体内使用select case <-time.After定时器问题

在go语言的代码中&#xff0c;我们经常会看到在在for循环体内使用select case <-time.After 的类似语句&#xff0c; 其实这个地方不管你是用 time.After(2 * time.Second) 还是 time.NewTicker(2 * time.Second) 的方式&#xff0c;如果放到for循环体内select case 则这个c…