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

官方案例 

Cesium Sandcastle

Cesium Sandcastle

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.hqwc.cn/news/700254.html

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

相关文章

C语言笔记15

指针2 1.数组名的理解 int arr[ 10 ] { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }; int *p &arr[ 0 ];17391692786 arr是数组名&#xff0c;数组名是首元素地址&#xff0c;&arr[0]就是取出首元素的地址放在指针变量p中。 #include <stdio.h> int main()…

Oracle 临时表空间的管理

Oracle 临时表空间的管理 临时表空间的处理 1.创建一个新的temporary tablespace; create temporary tablespace tp tempfile ...... size 10m autoextend on; 2.改变数据库的默认临时表空间 alter database default temporary tablespace tp; 3。drop tablespace temp; …

Python数据分析常用模块的介绍与使用

Python数据分析模块 前言一、Numpy模块Numpy介绍Numpy的使用Numpy生成数组ndarrayarray生成数组arange生成数组random生成数组其他示例 关于randint示例1示例2 关于rand Numpy数组统计方法示例 二、Pandas模块pandas介绍Series示例 DataFrame示例 三、其他模块Matplotlib/Seabo…

【JAVA】数组的定义与使用

前一篇我们讲述了方法的使用和递归&#xff0c;这一讲 我们来叙述一下数组相关知识点。最近更新较快&#xff0c;大家紧跟步伐哦~~ 1. 数组的基本概念 1.1 为什么要使用数组 假设现在要存5个学生的javaSE考试成绩&#xff0c;并对其进行输出&#xff0c;按照之前掌握的知识点&…

uniapp的底部弹出层实现保姆式教程

实现照片&#xff1a; 此过程先进入uniapp官网&#xff0c;找到扩展组件 打开找到里面的uni-popup和uni-icons 点击进入&#xff0c;下载&安装 点击下载并导入HBuilderX 导入到你使用的目录&#xff0c;如test目录 同样将uni-icons点击下载并导入HBuilderX 点击合并 此时te…

运输层(计算机网络谢希仁第八版)——学习笔记五

课件&#xff1a;课程包列表 (51zhy.cn) 目录 运输层协议概述 用户报协议UDP 传输控制协议TCP概述 可靠传输的工作原理 TCP可靠传输的实现 TCP的流量控制 TCP的拥塞控制 TCP的运输连接管理 运输层协议概述 进程之间的通信 运输层的位置——只有位于网络边缘部分的主机的协议栈才…

Jmeter+Grafana+Prometheus搭建压测监控平台

本文不介绍压测的规范与技术指标&#xff0c;本文是演示针对Jmeter如何将压测过程中的数据指标&#xff0c;通过Prometheus采集存储&#xff0c;并在Granfan平台进行仪表盘展示; 介绍 系统压测属于日常项目开发中的一个测试环节&#xff0c;使用测试工具模拟真实用户行为&…

Day 46 139.单词拆分

单词拆分 给定一个非空字符串 s 和一个包含非空单词的列表 wordDict&#xff0c;判定 s 是否可以被空格拆分为一个或多个在字典中出现的单词。 说明&#xff1a; 拆分时可以重复使用字典中的单词。 你可以假设字典中没有重复的单词。 示例 1&#xff1a; 输入: s “leet…

小红书自动私信获客,打造个人品牌

在当今这个内容为王、社交至上的时代&#xff0c;小红书作为新兴的社交电商平台&#xff0c;凭借其独特的社区氛围和强大的种草能力&#xff0c;成为了众多KOL、商家以及个人品牌打造的首选平台。想要在小红书上脱颖而出&#xff0c;精准引流获客&#xff0c;利用自动私信功能不…

国外新闻媒体推广:多元化媒体分发投放-大舍传媒

前言 &#xff1a;随着全球化的进程&#xff0c;国外新闻市场呈现出快速发展的趋势。在这个趋势下&#xff0c;国外新闻媒体推广成为了各行业企业宣传业务的重要一环。本文将重点介绍大舍传媒的多元化媒体分发投放服务&#xff0c;以及对国外新闻媒体推广的意义。 1. 多元化媒…

linux内核:持续更新

内核源码树 COPYING文件是内核许可证&#xff0c;CREDITS是开发了很多内核代码的开发者列表&#xff0c;MAINTAINERS是维护者列表&#xff0c;它们负责维护内核子系统和驱动程序&#xff0c;makefile是基本内核的makefile 向内核插入驱动模块 命令&#xff1a;insmod xxx.ko …

网络库-POCO介绍

1.简介 POCO C Libraries 提供一套 C 的类库用以开发基于网络的可移植的应用程序&#xff0c;它提供了许多模块&#xff0c;包括网络编程、文件系统访问、线程和并发、数据库访问、XML处理、配置管理、日志记录等功能。Poco库的设计目标是易于使用、高度可定制和可扩展。 包含…