首先我们通过链接和图片来看看效果
演示Demo链接地址:https://n3gis.github.io/exportToThree(3.0).html?scene=Demo_4
![](https://img-blog.csdnimg.cn/img_convert/c4a3dd5a3706e0372e8fb52d46c62841.png)
![](https://img-blog.csdnimg.cn/img_convert/92bca12ad7d1eefcd1006438b090db2b.webp?x-oss-process=image/format,png)
![](https://img-blog.csdnimg.cn/img_convert/a68787ff61426a37995c7d197932ff0f.png)
使用到的软件(软件大家到Unity商城上搜索,Unity商城地址:https://assetstore.unity.com)
Unity3D
3DTiles(Unity3D插件,用于加载OSGB格式的倾斜摄影数据)
Export To Three.js(Unity3D插件,将Unity3D的三维场景导出到Three.js中来渲染)
首先我们使用3DTiles插件将OSGB数据转换成3DTiles格式,在Unity3D软件菜单中,选择Window/3DTiles/ConvertTo3DTiles
![](https://img-blog.csdnimg.cn/img_convert/a0e7f24c904092e3411185e7fcdac5c9.png)
在弹出的窗口中,选择OSGB文件目录及转换后保持的文件目录,注意文件目录不要有中文路径
![](https://img-blog.csdnimg.cn/img_convert/9d2b4cc23b852514b1a3aa64b8edf0ea.png)
点击Convet按钮后,等待模型的转换完成,模型转换完成后,使用Single Tileset Load脚本在Unity编辑器中加载倾斜摄影模型,如下图所示
![](https://img-blog.csdnimg.cn/img_convert/89a726289cd1a563bd9455af7b034eaf.png)
接下来我们使用Export To Three.js(3.0)来导出倾斜摄影模型,在Unity3d菜单中,选择File/Export/Export To Three.js
![](https://img-blog.csdnimg.cn/img_convert/abdbd46eedc3162677e729d02be7a56f.png)
在弹出的窗口中,我们选择如下配置,其它配置项使用默认值来导出倾斜摄影模型
![](https://img-blog.csdnimg.cn/img_convert/ac3e06e9905013dd79754f0210da5724.png)
选择需要导出的相机及倾斜摄影模型,点击Export即可,导出后,可以在Setting中查看导出的文件目录,使用Export To Three.js(3.0)插件默认的js案例工程即可加载倾斜摄影数据;
![](https://img-blog.csdnimg.cn/img_convert/95054134887a20ebe8d1a537087c1e3b.png)
如下是使用Three.js加载的倾斜摄影效果
![](https://img-blog.csdnimg.cn/img_convert/b73a9c32a63e1460e28592c809ae9c2d.png)
ok,本节就讲到这里了,如果文章有看不懂的,可以观看如下视频教程