当前位置:网站首页>三维模型下载与动画控制
三维模型下载与动画控制
2022-06-29 12:09:00 【giao00000】
三维模型下载与动画控制
1. 模型下载地址
3D Warehouse https://3dwarehouse.sketchup.com/
Sketchfab https://sketchfab.com/
STK模型下载:STK V11.2及以上版本提供了
CZML导出功能,在导出时会让填写模型服务地址,默认的是http://assets.agi.com/models/

在导出CZML文件时STK会根据场景中每个对象设置的模型自动关联对应的模型地址(仅限于STK桌面端自带的三维模型)。然后可以打开CZML文件查看具体的模型地址,进行手动下载,如http://assets.agi.com/models/f-22a_raptor.gltf

可以根据STK自带的mdl模型来编写NodeJS脚本自动下载对应的gltf模型
/** * 下载AGI三维模型 */
// 文件下载 所需要的基本类
var fs = require("fs");
var path = require("path");
var request = require("request");
// 创建文件夹目录 判断文件是否创建
var dirPath = path.join(__dirname, "file");
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath);
console.log("文件夹创建成功");
} else {
console.log("文件夹已存在");
}
// 读取本地文件目录(STK安装目录)
const readDir = "D:\\Program Files\\AGI\\STK 11\\STKData\\VO\\Models\\Land";
fs.readdir(readDir, (err, files) => {
if (err) {
console.log("读取文件失败");
}
console.log(files);
files.forEach((item) => {
// 过滤后缀为gif的文件
let gifReg = /gif$/;
if (gifReg.test(item)) {
console.log(item);
// 截取模型名称
let modelName = item.slice(0, item.length - 4) + ".gltf";
let url = "https://assets.agi.com/models/" + modelName;
let stream = fs.createWriteStream(path.join(dirPath, modelName));
request(url).pipe(stream).on("close", function (err) {
console.log("文件[" + modelName + "]下载完毕");
});
}
})
})
2. 动画控制
主要在Cesium应用中进行三维模型的动画和关节控制,三维模型格式为gltf格式。
动画控制可以分成两种:
模型内置动画:模型内部本身就包括动画,模型建模时就有动画,如直升机螺旋桨的旋转,体现在gltf文件中就是
animations属性。另外Cesium提供了接口RunAnimation可以控制是否运行动画。
通过模型关节手动控制:模型中包括一系列的关节,如火箭发动机喷火、一二级分离等,体现在gltf文件中就是
articulations,配合Cesium的接口就可以控制模型在不同时刻具体关节的动作;关于如何在gltf文件中写入articulations属性,可以参考
[1]. https://agiweb.secure.force.com/faqs/articles/Keyword/What-Software-Setup-is-Required-to-Convert-Models-to-glTF
[2]. https://github.com/AnalyticalGraphicsInc/gmdf/tree/master/samples
[3]. https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/AGI_articulations/README.md
边栏推荐
- Lm07 - detailed discussion on cross section strategy of futures
- Cmake error
- 解决问题:ModuleNotFoundError: No module named ‘pip‘
- Gbase8s database select has an order by clause
- MFC dialog program core -isdialogmessage function -msg message structure -getmessage function -dispatchmessage function
- Gbase8s database select has order by Clause 6
- Difficult conversation breaks through the bottleneck of conversation and achieves perfect communication
- Can software related inventions be patented in India?
- Pangolin compilation error: 'numeric_ limits’ is not a member of ‘std’
- C # clue binary tree through middle order traversal
猜你喜欢

go 学习-搭建开发环境vscode开发环境golang

倍福TwinCAT3 的OPC_UA通信测试案例

C#通过中序遍历对二叉树进行线索化

Quick look | the long-awaited 2022 Guangzhou assistant testing engineer's real problem analysis is finally released

墨菲安全入选中关村科学城24个重点项目签约

Difficult conversation breaks through the bottleneck of conversation and achieves perfect communication
![[cloud native] 2.4 kubernetes core practice (middle)](/img/1e/b1b22caa03d499387e1a47a5f86f25.png)
[cloud native] 2.4 kubernetes core practice (middle)

AGCO AI frontier promotion (6.29)

oracle 19c : change the user sys/system username pasword under Linux

How to create new user for ORACLE 19c (CDB & PDB)
随机推荐
C#实现图的邻接矩阵和邻接表结构
Newton inequality
Pygame 对图像进行翻转
1. opencv realizes simple color recognition
nacos启动报错
安装typescript环境并开启VSCode自动监视编译ts文件为js文件
C#线索二叉树的定义
C # clue binary tree through middle order traversal
Mysql database master-slave synchronization, consistency solution
Blurred pictures become clear, one button two-color pictures, quickly organize local pictures These 8 online picture tools apply to join your favorites!
如何計算win/tai/loss in paired t-test
【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程
Interview shock 61: tell me about MySQL transaction isolation level?
C#实现二叉排序树定义、插入、构造
揭秘百度智能测试在测试自动执行领域实践
墨菲安全入选中关村科学城24个重点项目签约
Murphy safety was selected for signing 24 key projects of Zhongguancun Science City
C#实现队列结构定义、入队、出队操作
C#通過中序遍曆對二叉樹進行線索化
Gbase8s database select has order by Clause 2