我想在cesium的沙盒中增加自己的示例代码,怎么加呢?
假定是原沙盒中卡车跟随效果,搜索 CesiumMilkTruck.glb ;
访问路径 http://127.0.0.1:5501/Apps/Sandcastle/index.html?src=Particle%20System.html
cesium的版本是1.99,官网可以下载到cesium的源码。
1. 增加html文件
比如把原文件复制一份,重命名为 我们自己的文件。
文件名 : 00-Particle System-sunny.html
文件路径 : Apps\Sandcastle\gallery\00-Particle System-sunny.html
2. 增加图片文件
文件名 : 00-Particle System-sunny.jpg
文件路径: Apps\Sandcastle\gallery\00-Particle System-sunny.jpg
3. 修改索引文件
Apps\Sandcastle\gallery\gallery-index.js
在const gallery_demos 中增加自己的名字。
比如 :
```
{
name: '00-Particle System-sunny',
isNew: false,
img: '00-Particle System-sunny.jpg',
},
```
4. 沙盒中就可以看到刚刚我自己加的沙盒源码了。
5. 修改这个沙盒示例源码,直到满足想要的效果。
6. 最后封装到自己的项目中。
网友评论