forked from KhronosGroup/glTF
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
421 additions
and
0 deletions.
There are no files selected for viewing
113 changes: 113 additions & 0 deletions
113
extensions/2.0/Vendor/FRAUNHOFER_external_model/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# FRAUNHOFER_external_model | ||
|
||
## Contributors | ||
|
||
* Johannes Behr, Threedy GmbH, [@jbehr](https://github.com/jbehr) | ||
* Timo Sturm, Threedy GmbH, [@tsturm](https://github.com/tsturm) | ||
* Manuel Olbrich, Fraunhofer IGD [@dschie](https://github.com/dschie) | ||
|
||
## Status | ||
|
||
Fraunhofer Vendor Extension - Currently supported by [X3DOM](https://github.com/x3dom/x3dom) 1.8.0+ and [instant3Dhub](https://www.threedy.io/) 3.0.0+. | ||
|
||
## Dependencies | ||
|
||
Written against the glTF 2.0 spec. | ||
|
||
## Overview | ||
|
||
State representation containing domain related payload and links to further resources are the key concept of data on the web. The abstract RFC2077 [1] definition for the “model/\*” domain include 3D objects as payload and links inside the “model/\*” domain. Some registered standards (e.g. X3D) include links to other 3D-Models as base concepts. | ||
|
||
Those links allow a natural distribution of 3d data into more than one resource which support different change rates, reuse and logical packaging. | ||
|
||
Unfortunately referencing external models is not provided by the current glTF Specification. With our FRAUNHOFER_external_model extension we want to propose a simple way to support this. | ||
|
||
Client implementations of the FRAUNHOFER_external_model extension must support at least one glTF format but can support and negotiate any number of glTF and non-glTF encodings as long as those follow | ||
* the abstract model definition RFC2077 [1], | ||
* provide a registered content type (e.g. model/gltf+json) [2] | ||
* and can be determinate with some form of content negotiation [3]. | ||
|
||
Figure 1 shows a screenshot of our public available FRAUNHOFER_external_model [example](https://examples.x3dom.org/FRAUNHOFER_external_model/). | ||
|
||
<figure> | ||
<img src="./figures/figure0.png"> | ||
<figcaption><em>Figure 1: A glTF with FRAUNHOFER_external_model extension loaded in X3DOM. Left: local glTF mesh. middle: external glTF model, right: external X3D model (content negotiation).</em></figcaption> | ||
</figure> | ||
|
||
## glTF Schema Updates | ||
|
||
The proposed extension requires only a small amount of glTF Schema Updates. | ||
|
||
### Model Storage | ||
|
||
Models are stored in the newly introduced models array of the asset. | ||
|
||
Where each model contains one of | ||
|
||
* a URI to an external file in one of the supported model formats, or | ||
* a URI with embedded base64-encoded data, or | ||
* a reference to a bufferView; in that case mimeType must be defined. | ||
|
||
The following example shows three different ways of defining a model. | ||
* The first model is defined as a direct link to an external glTF file. | ||
* The second model is also defined as a direct link to an external model file, but without any suffix. This allows the Loader to use content negotiation [3] to fetch a preffered model format. | ||
* The third model is defined as a reference to a bufferview which contains glTF-Binary data. | ||
|
||
``` | ||
"models": | ||
[ | ||
{ | ||
"uri": "https://modeldatabase.io/primitives/box.gltf" | ||
}, | ||
{ | ||
"uri": "https://modeldatabase.io/primitives/box" | ||
}, | ||
{ | ||
"bufferView": 33, | ||
"mimeType" : "model/gltf-binary" | ||
} | ||
] | ||
``` | ||
|
||
> **Implementation Note:** When model data is provided by uri and mimeType is defined, client implementations should prefer JSON-defined MIME Type over one provided by transport layer. | ||
### Model Instantiation | ||
|
||
A model is instantiated by node.model property. The same model could be used by many nodes, which could have different transformations. For example: | ||
|
||
``` | ||
"nodes": | ||
[ | ||
{ | ||
"name": "Untransformed External Model", | ||
"model": 0 | ||
}, | ||
{ | ||
"name": "Transformed External Model", | ||
"model": 0, | ||
"translation": [ | ||
20, | ||
0, | ||
0 | ||
] | ||
} | ||
] | ||
``` | ||
|
||
### JSON Schema | ||
|
||
* [glTF.schema.json](schema/glTF.schema.json) | ||
* [model.schema.json](schema/model.schema.json) | ||
* [node.schema.json](schema/node.schema.json) | ||
|
||
## Known Implementations | ||
|
||
* [X3DOM](https://github.com/x3dom/x3dom) 1.8.0+ | ||
* [instant3Dhub](https://www.threedy.io/) 3.0.0+ | ||
|
||
## Resources | ||
|
||
* [1] RFC2077. 1997. Model Primary Content Type. (1997). Retrieved Jan 28, 2018 from https://tools.ietf.org/html/rfc2077 | ||
* [2] IANA. 2018. IANA Model Registration. (2018). Retrieved Jan 28, 2018 from https://www.iana.org/assignments/media-types/media-types.xhtml#model | ||
* [3] HTTP. 2018. HTTP Content Negotiation. (2018). Retrieved Jan 28, 2018 from https://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html | ||
* [4] Johannes Behr, Max Limper, and Timo Sturm. 2018. MoST: a 3D web architectural style for hybrid model data. In Proceedings of the 23rd International ACM Conference on 3D Web Technology (Web3D '18). ACM, New York, NY, USA, Article 21, 8 pages. DOI: https://doi.org/10.1145/3208806.3208823 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
163 changes: 163 additions & 0 deletions
163
extensions/2.0/Vendor/FRAUNHOFER_external_model/schema/glTF.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema", | ||
"title": "glTF", | ||
"type": "object", | ||
"description": "The root object for a glTF asset.", | ||
"allOf": [ { "$ref": "glTFProperty.schema.json" } ], | ||
"properties": { | ||
"extensionsUsed": { | ||
"type": "array", | ||
"description": "Names of glTF extensions used somewhere in this asset.", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"uniqueItems": true, | ||
"minItems": 1 | ||
}, | ||
"extensionsRequired": { | ||
"type": "array", | ||
"description": "Names of glTF extensions required to properly load this asset.", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"uniqueItems": true, | ||
"minItems": 1 | ||
}, | ||
"accessors": { | ||
"type": "array", | ||
"description": "An array of accessors.", | ||
"items": { | ||
"$ref": "accessor.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of accessors. An accessor is a typed view into a bufferView." | ||
}, | ||
"animations": { | ||
"type": "array", | ||
"description": "An array of keyframe animations.", | ||
"items": { | ||
"$ref": "animation.schema.json" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"asset": { | ||
"allOf": [ { "$ref": "asset.schema.json" } ], | ||
"description": "Metadata about the glTF asset." | ||
}, | ||
"buffers": { | ||
"type": "array", | ||
"description": "An array of buffers.", | ||
"items": { | ||
"$ref": "buffer.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of buffers. A buffer points to binary geometry, animation, or skins." | ||
}, | ||
"bufferViews": { | ||
"type": "array", | ||
"description": "An array of bufferViews.", | ||
"items": { | ||
"$ref": "bufferView.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of bufferViews. A bufferView is a view into a buffer generally representing a subset of the buffer." | ||
}, | ||
"cameras": { | ||
"type": "array", | ||
"description": "An array of cameras.", | ||
"items": { | ||
"$ref": "camera.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of cameras. A camera defines a projection matrix." | ||
}, | ||
"images": { | ||
"type": "array", | ||
"description": "An array of images.", | ||
"items": { | ||
"$ref": "image.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of images. An image defines data used to create a texture." | ||
}, | ||
"materials": { | ||
"type": "array", | ||
"description": "An array of materials.", | ||
"items": { | ||
"$ref": "material.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of materials. A material defines the appearance of a primitive." | ||
}, | ||
"meshes": { | ||
"type": "array", | ||
"description": "An array of meshes.", | ||
"items": { | ||
"$ref": "mesh.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of meshes. A mesh is a set of primitives to be rendered." | ||
}, | ||
"models": { | ||
"type": "array", | ||
"description": "An array of models.", | ||
"items": { | ||
"$ref": "model.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of models. A model defines data used to create a model." | ||
}, | ||
"nodes": { | ||
"type": "array", | ||
"description": "An array of nodes.", | ||
"items": { | ||
"$ref": "node.schema.json" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"samplers": { | ||
"type": "array", | ||
"description": "An array of samplers.", | ||
"items": { | ||
"$ref": "sampler.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of samplers. A sampler contains properties for texture filtering and wrapping modes." | ||
}, | ||
"scene": { | ||
"allOf": [ { "$ref": "glTFid.schema.json" } ], | ||
"description": "The index of the default scene." | ||
}, | ||
"scenes": { | ||
"type": "array", | ||
"description": "An array of scenes.", | ||
"items": { | ||
"$ref": "scene.schema.json" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"skins": { | ||
"type": "array", | ||
"description": "An array of skins.", | ||
"items": { | ||
"$ref": "skin.schema.json" | ||
}, | ||
"minItems": 1, | ||
"gltf_detailedDescription": "An array of skins. A skin is defined by joints and matrices." | ||
}, | ||
"textures": { | ||
"type": "array", | ||
"description": "An array of textures.", | ||
"items": { | ||
"$ref": "texture.schema.json" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"extensions": { }, | ||
"extras": { } | ||
}, | ||
"dependencies": { | ||
"scene": [ "scenes" ] | ||
}, | ||
"required": [ "asset" ] | ||
} |
44 changes: 44 additions & 0 deletions
44
extensions/2.0/Vendor/FRAUNHOFER_external_model/schema/model.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-04/schema", | ||
"title": "Model", | ||
"type": "object", | ||
"description": "Model data used to create a model. Model can be referenced by URI or `bufferView` index. `mimeType` is required in the latter case.", | ||
"allOf": [ { "$ref": "glTFChildOfRootProperty.schema.json" } ], | ||
"properties": { | ||
"uri": { | ||
"type": "string", | ||
"description": "The uri of the model.", | ||
"format": "uriref", | ||
"gltf_detailedDescription": "The uri of the model. Relative paths are relative to the .gltf file. Instead of referencing an external file, the uri can also be a data-uri. The model format must be gltf or glb.", | ||
"gltf_uriType": "image" | ||
}, | ||
"mimeType": { | ||
"anyOf": [ | ||
{ | ||
"enum": [ "model/gltf+json" ] | ||
}, | ||
{ | ||
"enum": [ "model/gltf-binary" ] | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
], | ||
"description": "The models's MIME type. Required if `bufferView` is defined." | ||
}, | ||
"bufferView": { | ||
"allOf": [ { "$ref": "glTFid.schema.json" } ], | ||
"description": "The index of the bufferView that contains the model. Use this instead of the model's uri property." | ||
}, | ||
"name": { }, | ||
"extensions": { }, | ||
"extras": { } | ||
}, | ||
"dependencies": { | ||
"bufferView": [ "mimeType" ] | ||
}, | ||
"oneOf": [ | ||
{ "required": [ "uri" ] }, | ||
{ "required": [ "bufferView" ] } | ||
] | ||
} |
Oops, something went wrong.