gltf - How to add metadata on a gltf file?
问题描述
I have a gltf that is a set of building.
I would like to add some information on each building, and for this, I need to add some properties to my gltf models.
But, I tried to add something like this
{
"accessors": [
{
"name": "object_1_1_0_positions",
"componentType": 5126,
"count": 4,
"min": [
-232.96347045898438,
3.5689821243286133,
-204.4241485595703
],
"max": [
-230.46347045898438,
35.427982330322266,
-204.4241485595703
],
"properties" : { "description" : "my description 1" }
"type": "VEC3",
"bufferView": 0,
"byteOffset": 0
},
{
"name": "object_1_1_0_normals",
"componentType": 5126,
"count": 4,
"min": [
-0.1212499663233757,
0,
0.9926220178604126
],
"max": [
-0.1212499663233757,
0,
0.9926220178604126
],
"properties" : { "description" : "my description 2" }
"type": "VEC3",
"bufferView": 1,
"byteOffset": 0
},
.....
}
but this break the gltf.
how do I add some metadata to gltf ?
解决方案
The glTF specification allows metadata to be attached to objects through an extras
property:
https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#reference-extras
"extras" : { "description" : "my description 2" }
In addition, don't forget to include a comma after the property – this change must be valid JSON.
推荐阅读
- amazon-web-services - 如何在手机/短信中确认 AWS SNS 订阅?
- scala - 迭代一个 RDD[A],其中 A 包含 List[B]
- java - 使用java连接到windows远程服务器并修改一些文件?
- django - Python Django Ubuntu Server 16.04 aws 内部服务器错误
- javascript - javascript中的简单while循环不遵守限制
- sql - 在 SELECT 中使用子查询会返回我无法解释的错误
- memory - Pentaho:阻止这一步,直到步骤完成
- swift - 告诉 UITableView 哪些数据应该在 Swift 中显示的最佳方法
- html - 拿不到
- 显示在 :hover of another
- c++ - 如何用cmake构建凯特?