【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.pswp.cn/web/12337.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/12337.shtml
英文地址,請注明出處:http://en.pswp.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…