首页 > 其他分享 >Cesium学习笔记3——加载倾斜摄影模型

Cesium学习笔记3——加载倾斜摄影模型

时间:2023-07-08 09:44:22浏览次数:52  
标签:tileset viewer 笔记 3dtiles Cesium true 加载

本地的3dtiles模型采用ContextCapture 19生成. 利用Cesium实验室V3.08对OSGB格式转换到3dtiles,得到的结果加载时老是报

TypeError: Cannot read properties of undefined (reading 'updateTransform')错误。

没搞明白为啥,不过3dtiles文件夹层级目录的命名应该从以前到现在发生了不少改变。

目前CC19生成的目录如下:

  

发布后加载,有时候始终出不来,用CesiumLab三维可视功能加载一下,突然又好了,挺诡异的,还得再测试一下。

源码:

 1 <!DOCTYPE html>
 2 <html lang="en">
 3   <head>
 4     <!-- Use correct character set. -->
 5     <meta charset="utf-8" />
 6     <!-- Tell IE to use the latest, best version. -->
 7     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
 8     <!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
 9     <meta
10       name="viewport"
11       content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"
12     />
13     <title>Hello World!</title>
14     <script src="../Build/CesiumUnminified/Cesium.js"></script>
15     <style>
16       @import url(../Build/CesiumUnminified/Widgets/widgets.css);
17       html,
18       body,
19       #cesiumContainer {
20         width: 100%;
21         height: 100%;
22         margin: 0;
23         padding: 0;
24         overflow: hidden;
25       }
26     </style>
27   </head>
28   <body>
29     <div id="cesiumContainer"></div>
30     <script>
31       Cesium.Ion.defaultAccessToken='你的Token';
32     var viewer = new Cesium.Viewer('cesiumContainer', {
33         timeline:false,
34         animation:false,
35         vrButton:true,
36         sceneModePicker:false,
37         infoBox:true,
38         scene3DOnly:true,
39         terrainProvider: Cesium.createWorldTerrain()
40       });
41       viewer._cesiumWidget._creditContainer.style.display = "none"; 
42       var tileset = new Cesium.Cesium3DTileset({
43       url: "../Scene/tileset.json",
44       maximumScreenSpaceError : 1});
45       <!-- const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(40866);-->
46       viewer.scene.primitives.add(tileset);
47     viewer.zoomTo(tileset);
48     viewer.homeButton.viewModel.command.beforeExecute.addEventListener(function(commandInfo) {
49         // Fly to tileset
50         viewer.flyTo(tileset);
51 
52         // Tell the home button not to do anything
53         commandInfo.cancel = true;
54     });
55     </script>
56   </body>
57 </html>

效果:

 

标签:tileset,viewer,笔记,3dtiles,Cesium,true,加载
From: https://www.cnblogs.com/yhlx125/p/17536655.html

相关文章

  • 公司刚来的京东架构师:看完我写的spring笔记,甩给了我一份文档
    pring是分层的full-stack(全栈)轻量级开源框架,以IoC和AOP为内核,提供了展现层SpringMVC和业务层事务管理等众多的企业级应⽤技术,还能整合开源世界众多著名的第三⽅框架和类库,已经成为使⽤最多的JavaEE企业应⽤开源框架。  本文目录:Spring概述核心思想手写......
  • 【企业项目实战】Spring Boot 启动时加载指定方法
    ......
  • [学习笔记]python爬虫初体验
    同学吹水,提到了爬虫,于是金工实习回来晚上看了看爬虫(话说为啥所有爬虫教程前面都是一大串python基础教程啊)importurllib.request#1、定义一个网址urlurl='http://www.baidu.com'#2、模拟浏览器向服务器发送请求response=urllib.request.urlopen(url)print(type(response......
  • Dockerfile加载cache提速制作golang业务镜像
    Dockerfile#syntax=docker/dockerfile:1.2FROMgolang-1.18.5:ubuntu-22.04ASbuilderENVCGO_ENABLED0ENVGOOSlinuxENVGOPROXYhttps://goproxy.cn,directWORKDIR/build/COPYgo.*.RUNgomoddownloadCOPY..RUN--mount=type=cache,target=/root/.......
  • Java官方笔记14流
    ProcessingDatainMemoryTheStreamAPIisprobablythesecondmostimportantfeatureaddedtoJavaSE8,afterthelambdaexpressions.Inanutshell,theStreamAPIisaboutprovidinganimplementationofthewellknownmap-filter-reducealgorithmtoth......
  • openGauss学习笔记-02 openGauss系统架构
    openGauss学习笔记-02openGauss系统架构openGauss是单机系统,在这样的系统架构中,业务数据存储在单个物理节点上,数据访问任务被推送到服务节点执行,通过服务器的高并发,实现对数据处理的快速响应。同时通过日志复制可以把数据复制到备机,提供数据的高可靠和读扩展。2.1软件架构open......
  • EasyCVR接入大量设备级联后出现分组加载异常是什么原因?
    EasyCVR可拓展性强、视频能力灵活、部署轻快,可支持的主流标准协议有GB28181、RTSP/Onvif、RTMP等,以及厂家私有协议与SDK接入,包括海康Ehome、海大宇等设备的SDK等,能对外分发RTSP、RTMP、FLV、HLS、WebRTC等格式的视频流。有用户反馈,在EasyCVR用户现场接入了大量设备,出现了设备分......
  • SpringBoot3 学习笔记(开始配置)
    一、使用工具IntelliJ,下载JDK20https://www.oracle.com/java/technologies/downloads/二、采用SpringInitializr新建项目, 三、勾选web和lombok四、点Finish后等待新建目录如下,删掉无用的目录和文件:五、最终如下: 六、右键com.wind,新建controller.HellWorldController......
  • DBS学习笔记(二):RDS
    概述支持的引擎:PostgreSQL,MySQL,MariaDB,Oracle,MicrosoftSQLServer,Aurora在一个VPC内启动:常使用私有子网,用securitygroups控制权限(如使用Lambda时)使用EBS储存:gp2或io1,可自动扩展容量备份:自动根据时间点恢复,备份过期监控:使用CloudWatchRDSEvents:SNS事件提醒1credit=......
  • 006 学习笔记--内置函数 | 字符串函数 + 数值函数 + 日期函数 + 流程控制函数(if ifnu
    函数:是指一段可以直接被另一段程序调用的程序或代码。MySQL内置函数: 字符串函数-------------------------------mysql内置函数--字符串函数-------------------------------字符串拼接--CONCAT(str1,str2,...)selectCONCAT('I','love','you');--returnIlove......