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

2024-05-15 03:20

本文主要是介绍【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

这篇关于【Cesium解读】Cesium中primitive/entity贴地的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/990667

相关文章

MySQL中时区参数time_zone解读

《MySQL中时区参数time_zone解读》MySQL时区参数time_zone用于控制系统函数和字段的DEFAULTCURRENT_TIMESTAMP属性,修改时区可能会影响timestamp类型... 目录前言1.时区参数影响2.如何设置3.字段类型选择总结前言mysql 时区参数 time_zon

MySQL中的锁和MVCC机制解读

《MySQL中的锁和MVCC机制解读》MySQL事务、锁和MVCC机制是确保数据库操作原子性、一致性和隔离性的关键,事务必须遵循ACID原则,锁的类型包括表级锁、行级锁和意向锁,MVCC通过非锁定读和... 目录mysql的锁和MVCC机制事务的概念与ACID特性锁的类型及其工作机制锁的粒度与性能影响多版本

Redis过期键删除策略解读

《Redis过期键删除策略解读》Redis通过惰性删除策略和定期删除策略来管理过期键,惰性删除策略在键被访问时检查是否过期并删除,节省CPU开销但可能导致过期键滞留,定期删除策略定期扫描并删除过期键,... 目录1.Redis使用两种不同的策略来删除过期键,分别是惰性删除策略和定期删除策略1.1惰性删除策略

Redis与缓存解读

《Redis与缓存解读》文章介绍了Redis作为缓存层的优势和缺点,并分析了六种缓存更新策略,包括超时剔除、先删缓存再更新数据库、旁路缓存、先更新数据库再删缓存、先更新数据库再更新缓存、读写穿透和异步... 目录缓存缓存优缺点缓存更新策略超时剔除先删缓存再更新数据库旁路缓存(先更新数据库,再删缓存)先更新数

C#反射编程之GetConstructor()方法解读

《C#反射编程之GetConstructor()方法解读》C#中Type类的GetConstructor()方法用于获取指定类型的构造函数,该方法有多个重载版本,可以根据不同的参数获取不同特性的构造函... 目录C# GetConstructor()方法有4个重载以GetConstructor(Type[]

MCU7.keil中build产生的hex文件解读

1.hex文件大致解读 闲来无事,查看了MCU6.用keil新建项目的hex文件 用FlexHex打开 给我的第一印象是:经过软件的解释之后,发现这些数据排列地十分整齐 :02000F0080FE71:03000000020003F8:0C000300787FE4F6D8FD75810702000F3D:00000001FF 把解释后的数据当作十六进制来观察 1.每一行数据

Java ArrayList扩容机制 (源码解读)

结论:初始长度为10,若所需长度小于1.5倍原长度,则按照1.5倍扩容。若不够用则按照所需长度扩容。 一. 明确类内部重要变量含义         1:数组默认长度         2:这是一个共享的空数组实例,用于明确创建长度为0时的ArrayList ,比如通过 new ArrayList<>(0),ArrayList 内部的数组 elementData 会指向这个 EMPTY_EL

Spring 源码解读:自定义实现Bean定义的注册与解析

引言 在Spring框架中,Bean的注册与解析是整个依赖注入流程的核心步骤。通过Bean定义,Spring容器知道如何创建、配置和管理每个Bean实例。本篇文章将通过实现一个简化版的Bean定义注册与解析机制,帮助你理解Spring框架背后的设计逻辑。我们还将对比Spring中的BeanDefinition和BeanDefinitionRegistry,以全面掌握Bean注册和解析的核心原理。

GPT系列之:GPT-1,GPT-2,GPT-3详细解读

一、GPT1 论文:Improving Language Understanding by Generative Pre-Training 链接:https://cdn.openai.com/research-covers/languageunsupervised/language_understanding_paper.pdf 启发点:生成loss和微调loss同时作用,让下游任务来适应预训

LLM系列 | 38:解读阿里开源语音多模态模型Qwen2-Audio

引言 模型概述 模型架构 训练方法 性能评估 实战演示 总结 引言 金山挂月窥禅径,沙鸟听经恋法门。 小伙伴们好,我是微信公众号《小窗幽记机器学习》的小编:卖铁观音的小男孩,今天这篇小作文主要是介绍阿里巴巴的语音多模态大模型Qwen2-Audio。近日,阿里巴巴Qwen团队发布了最新的大规模音频-语言模型Qwen2-Audio及其技术报告。该模型在音频理解和多模态交互