当前位置:网站首页>Cesium加载3D Tiles模型
Cesium加载3D Tiles模型
2022-06-22 06:46:00 【GIS开发者】
最近遇到一个问题,使用大疆无人机做的倾斜摄影三维模型,需要加载到地图上进行显示。从大疆的制图软件导出后,三维模型文件的后缀名为b3dm,经查阅资料发现,是3D Tiles格式。
3D Tiles
3D Tiles是一种开放的三维空间数据标准,其设计目的主要是为了提升大的三维场景中模型的加载和渲染速度,可以理解为三维场景的瓦片。假如要在Web客户端渲染一个非常大的三维模型(如一个大城市的建筑模型),如果把模型全部下载到客户端并且进行渲染,这个过程所消耗的时间对于使用普通电脑的用户来说是不能接受的。然而,在绝大多数的用户交互式的三维场景中,都只需要渲染模型的一小部分,将三维模型全部加载并渲染是一种极大的资源浪费,3D Tiles为这个问题提供了一个很好的解决方案。将三维空间数据组织为3D Tiles格式,可以实现模型的按需加载和渲染,从而实现流畅的三维模型浏览体验。3D Tiles也是按树形结构组织的层次模型,不同的是二维瓦片地图是对二维空间进行划分,3D Tiles是对三维空间进行划分。
加载代码
vue与cesium开发环境搭建,参考https://blog.csdn.net/GISuuser/article/details/125376282?spm=1001.2014.3001.5501
<template>
<div id="cesiumContainer">
</div>
</template>
<script> import * as Cesium from 'cesium'; export default {
name: 'HelloWorld', props: {
msg: String }, setup(){
window.CESIUM_BASE_URL = '/cesium/'; Cesium.Ion.defaultAccessToken = '你申请的token'; }, mounted(){
// "cesiumContainer"是需要渲染地图的dom的id. const viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider: Cesium.createWorldTerrain() }); let tileSetModel = new Cesium.Cesium3DTileset({
url: "./terra_b3dms/tileset.json" }); tileSetModel.readyPromise.then( tileset=> {
console.log("加载完成") viewer.scene.primitives.add(tileset); viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.5, -0.2, tileset.boundingSphere.radius * 1.0)); }).catch(function (error) {
console.log(error); }); } } </script>
<style scoped> #cesiumContainer{
width: 100%; height: 100%; } </style>
代码中,使用到的3D Tiles模型,可以在https://download.csdn.net/download/GISuuser/85708223?spm=1001.2014.3001.5503下载
效果


边栏推荐
- Unsafe concurrency of collection classes
- 仙人掌之歌——进军To C直播(1)
- 《数据安全实践指南》- 数据采集安全实践-数据分类分级
- Install boost
- In depth analysis of 20million OP events stolen by optimization (including code)
- 【5G NR】NAS连接管理—CM状态
- [CPU design practice] fundamentals of digital logic circuit design (I)
- Tableau 连接mysql详细教程
- Iframe framework, native JS routing
- Leetcode: interview question 08.12 Eight queens [DFS + backtrack]
猜你喜欢

Single cell literature learning (Part3) -- dstg: deconvoluting spatial transcription data through graph based AI

leetcode:面试题 08.12. 八皇后【dfs + backtrack】

Py之scorecardpy:scorecardpy的简介、安装、使用方法之详细攻略

Callable

Which is the best agency mode or decoration mode

SQL 注入漏洞(十三)base64注入

C技能树评测——用户至上做精品

MySQL Niuke brush questions

Detailed tutorial on connecting MySQL with tableau

关于solidity的delegatecall的坑
随机推荐
实训渗透靶场02|3星vh-lll靶机|vulnhub靶场Node1
Don't throw away the electric kettle. It's easy to fix!
[rust notes] 01 basic types
Cactus Song - online operation (5)
Error encountered while importing keras typeerror: descriptors cannot not be created directly If this call came from a _
【M32】单片机 svn 设置忽略文件
[5g NR] UE registration management status
[CPU design practice] fundamentals of digital logic circuit design (I)
六月集训(第22天) —— 有序集合
EMC solutions
[openairinterface5g] RRC NR resolution (I)
-bash: telnet: command not found的解决方法
Single cell literature learning (Part3) -- dstg: deconvoluting spatial transcription data through graph based AI
OpenGL - Textures
Qt development simple Bluetooth debugging assistant (low power Bluetooth)
SQL injection vulnerability (XI) wide byte injection
仙人掌之歌——进军To C直播(3)
[openairinterface5g] project directory structure
【5G NR】NAS连接管理—CM状态
Vulnérabilité à l'injection SQL (XIII) injection base64