Skip to content

Commit

Permalink
#210 Morph Targets instatiation
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliano committed Feb 24, 2017
1 parent 1de1427 commit 28ebbd6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
22 changes: 22 additions & 0 deletions specification/2.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,28 @@ The joint hierarchy used in animation is simply the glTF node hierarchy, with ea

For more details of vertex skinning, refer to [glTF Overview](figures/gltfOverview-0.2.0.png).

#### Morph Targets Instances

A Morph Target is instanced within a node using:
- The Morph Target referenced in the `mesh` property.
- The Morph Target `weights` overriding the `weights` of the Morph Target referenced in the `mesh` property.
The example below instatiates a Morph Target together with a Skin.

```json
{
"nodes": [
{
"mesh": 11,
"skeletons": [
21
],
"skin": 0,
"weights": [0 0.5]
}
]
}
```

#### Textures

All textures are stored in the asset's `textures` array. A texture is defined by an image file, denoted by the `source` property; `format` and `internalFormat` specifiers, corresponding to the GL texture format types; a `target` type for the sampler; a sampler identifier (`sampler`), and a `type` property defining the internal data format. Refer to the GL definition of `texImage2D()` for more details.
Expand Down
15 changes: 12 additions & 3 deletions specification/2.0/schema/node.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema" : "http://json-schema.org/draft-04/schema",
"title" : "node",
"type" : "object",
"description" : "A node in the node hierarchy. A node can have either the `camera`, `meshes`, or `skeletons`/`skin`/`meshes` properties defined. In the later case, all `primitives` in the referenced `meshes` contain `JOINT` and `WEIGHT` attributes and the referenced `material`/`technique` from each `primitive` has parameters with `JOINT` and `WEIGHT` semantics. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.",
"description" : "A node in the node hierarchy. A node can have either the `camera`, `mesh`, or `skeletons`/`skin`/`mesh` properties defined. In the later case, all `primitives` in the referenced `mesh` contain `JOINT` and `WEIGHT` attributes and the referenced `material`/`technique` from each `primitive` has parameters with `JOINT` and `WEIGHT` semantics. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.",
"allOf" : [ { "$ref" : "glTFChildOfRootProperty.schema.json" } ],
"properties" : {
"camera" : {
Expand Down Expand Up @@ -81,13 +81,22 @@
"maxItems" : 3,
"default" : [ 0.0, 0.0, 0.0 ]
},
"weights" : {
"type" : "array",
"description" : "The weights of the instantiated Morph Target",
"items" : {
"type": "number"
},
"default" : []
},
"name" : {},
"extensions" : {},
"extras" : {}
},
"dependencies" : {
"skeletons" : ["skin", "meshes"],
"skin" : ["skeletons", "meshes"]
"skeletons" : ["skin", "mesh"],
"skin" : ["skeletons", "mesh"],
"weights": ["mesh"],
},
"additionalProperties" : false
}

0 comments on commit 28ebbd6

Please sign in to comment.