IIIF / api

Source for API and model specifications documents (api and model)
http://iiif.io/api
105 stars 54 forks source link

DirectionTransform #2268

Open tomcrane opened 5 months ago

tomcrane commented 5 months ago

Lights (#2258) and cameras (#2257) both require a DirectionTransform resource, and we can use this issue to develop that across both.

From those two issues:

[A DirectionTransform specifies] orientation/directional-facing for an element that needs such facing, like a light or a camera. [...] To specify orientiation, DirectionTransform should take either a unit-length vector or a Scene reference target combined with a PointSelector. In the latter case, this PointSelector location specifies the "look-at" target of the light [or camera], and the orientation would have to be calculated from a combination of the light [or camera] position within the scene and the position of the look-at target.

(Julie's note: should cameras be required to specify a Scene reference and PointSelector and not be allowed to use a vector orientation?)

tomcrane commented 5 months ago

... either a unit-length vector or a Scene reference target combined with a PointSelector [the latter] specifies the "look-at" target

Could a DirectionTransform also use the id of another annotation as the "look-at", for ease of use? "Camera, look at the spaceman."

tomcrane commented 5 months ago
      "body": {
        "type": "[Camera or Light]",
        // other properties of camera or light

        "transforms": [
            {
                 "type": "DirectionTransform",
                  // props to be explored
            }
         ]
     }

Unit vector

            {
                 "type": "DirectionTransform",
                  // what would the unit vector look like here?
            }

PointSelector

            {
                 "type": "DirectionTransform",
                  // props to be explored
                  // a lot like *target*
                  // ??
                  ....
                          "type": "SpecificResource",
                          "source": [
                              {
                                  "id": "https://example.org/iiif/scene1/page/p1/1",
                                  "type": "Scene"
                              }
                          ],
                          "selector": [
                              {
                                  "type": "PointSelector",
                                  "x": 100.0,
                                  "y": 100.0,
                                  "z": 0.0
                              }
                          ]
            }

"look At"

            {
                 "type": "DirectionTransform",
                  // ??? This is the anno whose body is the spaceman model
                        {
                          "id": "https://example.org/iiif/3d/anno1",
                          "type": "Annotation"
                        },
            }
azaroth42 commented 5 months ago

Seems like a special case of RotationTransform to me. Instead of rotating a fixed amount relative to a starting position, rotate an arbitrary amount relative to a target point, where the target is either an explicit x,y,z point, or the point at the origin of a specified content resource.

tomcrane commented 5 months ago

Consider use cases for walking through multiple points in a story within a Scene -successive cameras looking at successive labels - helps if you can lookAt the label annotation by its URI.

azaroth42 commented 5 months ago

Why not:

{
  "type": "RotationTransform",
  "lookAt": {
    // point or model 
  }
}
azaroth42 commented 5 months ago

Use case for vector: Directional Light only has a vector, but no position as it's infinitely far away and infinitely large

azaroth42 commented 5 months ago

Resolution from 2024-01-31 -- lookAt property, not a DirectionTransform. No need for a DirectionTransform. Issue is readyForEds with respect to lookAt.