Skip to content

Commit df3cf1d

Browse files
authored
Merge pull request #2353 from IIIF/prezi-4-transforms
Update transform property and class definitions. Merging, can edit again in place
2 parents fbf49a2 + d9d168e commit df3cf1d

File tree

1 file changed

+55
-10
lines changed

1 file changed

+55
-10
lines changed

source/presentation/4.0/model.md

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -781,32 +781,62 @@ Can have a Timeline as the source of the audio?
781781

782782
FIXME: "No default direction, MUST provide a Rotate Transform.", changed language to default to -y to match Spot Light
783783

784-
785784
#### Transforms
786785

787-
here are the rules about transforms?
788-
786+
An operation to transform a 3D resource. Transforms are specified by the [transform](#transform) property on a Specific Resource. Transforms are carried out on a resource in the implicit or explicit local coordinate space of the resource, and are performed prior to painting that resource into the relatively more global coordinate space of a Scene.
789787

788+
__Properties__<br/>
789+
All Transforms _MUST_ have the following properties: [type](#type).<br/><br/>
790+
All Transforms _MAY_ have the following properties: [x](#x), [y](#y), and [z](#z).
791+
{: .note}
790792

791793
##### Rotate Transform
792794

793795
> `"type": "RotateTransform"`
794796
795-
A RotateTransform rotates the local coordinate space around the given axis in a counter-clockwise direction around the axis itself (e.g. around a pivot point of 0 on the axis). A point that was at x=1,y=1 and was rotated 90 degrees around the x axis would be at x=1,y=0,z=1. If an axis value is not specified, then it is not changed, resulting in a default of 0.0
797+
A RotateTransform rotates the resource around one or more axes. If present, the values of properties `x`, `y`, and `z` _MUST_ be angular values in degrees that specify the extent of rotation around each axis. Positive angular values indicate counter-clockwise rotation around the axis due to coordinate right-handedness. Axis rotation is performed with a pivot point at the origin of the local coordinate space. As an example, for a point at (1, 1, 0) in local coordinate space, rotating 90 degrees around the x axis would transform the point to be at (1, 0, 1). If any property `x`, `y`, or `z` is not specified or is specified to be 0.0, rotation around that axis does not occur. When more than one axis rotation is specified through multiple non-zero values for `x`, `y`, and `z`, rotations comprise an Euler angle with ordering x-y-z, and rotation _MUST_ be carried out first around the x axis, second around the y axis, and third around the z axis.
796798

799+
{% include api/code_header.html %}
800+
```json
801+
{
802+
"type": "RotateTransform",
803+
"x": 0.0,
804+
"y": 180.0,
805+
"z": 0.0
806+
}
807+
```
797808

798809
##### Scale Transform
799810

800811
> `"type": "ScaleTransform"`
801812
802-
A ScaleTransform applies a multiplier to one or more axes in the local coordinate space. A point that was at 3.5, after applying a ScaleTransform of 2.0 would then be at 7.0. If an axis value is not specified, then it is not changed, resulting in a default of 1.0
813+
A ScaleTransform scales the resource along one or more axes. If present, the values of properties `x`, `y`, and `z` _MUST_ be multiplicative scale factors that specify the extent of scaling along each axis. As an example, for a point at 3.5 along the x axis in local coordinate space, scaling along the x axis by 2.0 would result in the point being at 7.0. If any property `x`, `y`, or `z` is not specified or is specified to be 1.0, scaling does not occur along that axis. Negative scale factor values indicate mirroring as well as scaling along that axis.
814+
815+
{% include api/code_header.html %}
816+
```json
817+
{
818+
"type": "ScaleTransform",
819+
"x": 2.0,
820+
"y": 2.0,
821+
"z": 2.0
822+
}
823+
```
803824

804825
##### Translate Transform
805826

806827
> `"type": "TranslateTransform"`
807828
808-
A TranslateTransform moves all of the objects in the local coordinate space the given distance along the axis. A point that was at x=1.0, after applying a TranslateTransform of x=1.0 would be at x=2.0. If an axis value is not specified then it is not changed, resulting in a default of 0.0
829+
A TranslateTransform translates or moves the resource across one or more axes. If present, the values of properties `x`, `y`, and `z` _MUST_ be coordinate unit distances that specify the distance across each axis to translate the resource. As an example, for a point at 1.0 along the x axis, translating across the x axis by 3.0 would result in the point being at 4.0. If any property `x`, `y`, or `z` is not present or is specified to be 0.0, translation does not occur across that axis.
809830

831+
{% include api/code_header.html %}
832+
```json
833+
{
834+
"type": "TranslateTransform",
835+
"x": -1.0,
836+
"y": 0.0,
837+
"z": 0.0
838+
}
839+
```
810840

811841
### Utility Classes
812842

@@ -2110,13 +2140,28 @@ The value of this property _MUST_ be a non-negative integer.
21102140
### transform
21112141
{: #transform}
21122142

2113-
_Summary here_
2114-
2115-
The value of this property is an array of JSON objects, each of which is a Transform.
2143+
An ordered list of 3D transform operations (translation, rotation, and scale) to be performed on a resource prior to painting that resource into a Scene. Transforms _MUST_ be applied to the resource in the order given. The resulting state of the resource after applying a transform _MUST_ be the input state for the subsequent transform in the ordered list. Therefore, transforms are not independent, and different orders of the same set of transforms can produce different results. The list of transforms _MAY_ include multiple transforms of the same type, e.g., multiple rotation operations.
21162144

2117-
Process them in order given.
2145+
The value of this property _MUST_ be array of JSON objects, each of which _MUST_ be a Transform.
21182146

2147+
* A Specific Resource _MAY_ have the `transform` property.<br/>
2148+
Clients _SHOULD_ process the `transform` property on Specific Resources.
2149+
* Other classes _MUST NOT_ have the `transform` property.<br/>
2150+
Clients _MUST_ ignore the `transform` property on all other classes.
21192151

2152+
{% include api/code_header.html %}
2153+
```json
2154+
{
2155+
"transform": [
2156+
{
2157+
"type": "RotateTransform",
2158+
"x": 0.0,
2159+
"y": 180.0,
2160+
"z": 0.0
2161+
}
2162+
]
2163+
}
2164+
```
21202165

21212166
### type
21222167
{: #type}

0 commit comments

Comments
 (0)