IIIF / api

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

Can you target the whole `Scene`? #2254

Open tomcrane opened 11 months ago

tomcrane commented 11 months ago

For the Canvas, a painting annotation can target the entire Canvas by id alone, without supplying a selector or xywh fragment shorthand. This is the 99.9…% use case for published Canvases. The implication is that the content resource fills the Canvas. But we can’t “fill” our unbounded 3D space.

Should we support the equivalent simple scenario of one 3D model in a Scene, with a painting annotation targeting the Scene by id (or by reference object with { id, type })? This seems a very useful pattern and is simple for the publisher.

    // ...
    "type": "AnnotationPage",
    "items": [
        {
            "id": "https://example.org/iiif/3d/anno1",
            "type": "Annotation",
            "motivation": [
                "painting"
            ],
            "body": {
                "id": "https://example.org/iiif/my-model.someFormat",
                "type": "Model",
                "format": "application/something"
            },
            "target": [
                "https://example.org/iiif/scene1/page/p1/1"
            ]
        }
    ]
    // ...

If so, what does this mean?

We can place the centroid of the model at the Scene’s (0,0,0) origin.

But how big is it? What are the dimensions of its bounding box?

Is this defined by the incoming model? We can take the incoming model’s “local” origin as the point that is placed at the origin (as per target issue), but can we get scale this way? (seems too loose given multitude of formats and their internal coordinate systems)?

This is important because if the Scene is later annotated (e.g., descriptive labels), those annotations need to target somewhere in the Scene, aligned with the model.

azaroth42 commented 11 months ago

I think you need to be able to target the entire scene for other reasons -- that you want to comment on it, or tag it, or use it in a content state annotation -- but the reason that it is simple for the 2d case is that there are boundaries for scaling.

Agree about the future annotations being problematic, but no more problematic than if you change the model being annotated to a larger one and don't subsequently add a scale transformation on it to bring it back to the Scene's dimensions. It just works in the bounded case ... it won't in the unbounded case. However, I think the risk is relatively low at least given the experience of 2d, as most organizations don't just silently replace their images (and by extrapolation models) with the same content at a different resolution.

We should discuss, but I would be in favor of allowing a painting annotation on the scene to be considered as at 0,0,0 (and then annotation target dependent as to what that means ... does the 2d image have it's 0,0 point at 3d space's 0,0,0?)

JulieWinchester commented 8 months ago

At the Basel working meeting on October 26, 2023, there was general consensus in favor of painting annotations being able to target an entire scene via simple target reference of a Scene URI, and that doing so will place the annotation at the Scene origin (0, 0, 0). This scene origin placement behavior will not apply to comment annotations.

There was also a suggestion that potentially an OriginSelector (plus a Scene URI reference) could be used if we want to be able to explicitly designate that an annotation's target is the specific scene origin while still simplifying the manifest without needing to always specify a redundant boilerplate PointSelector of 0, 0, 0.

tomcrane commented 5 months ago

Target scenarios

Simple 99% case

            "target": [
                "https://example.org/iiif/scene1/page/p1/1"
            ]

Only applicable to painting annotations?

Specific positioning at (0,0,0)

    "target": [
        {
            "type": "SpecificResource",
            "source": [
                {
                    "id": "https://example.org/iiif/scene1/page/p1/1",
                    "type": "Scene"
                }
            ],
            "selector": [
                {
                    "type": "PointSelector",
                    "x": 0,
                    "y": 0,
                    "z": 0
                }
            ]
        }
    ]

Possible OriginSelector

    "target": [
        {
            "type": "SpecificResource",
            "source": [
                {
                    "id": "https://example.org/iiif/scene1/page/p1/1",
                    "type": "Scene"
                }
            ],
            "selector": [
                {
                    "type": "OriginSelector"
                }
            ]
        }
    ]

What are the scenarios in which you would use the OriginSelector?

azaroth42 commented 5 months ago

~Propose a new issue for OriginSelector?~ Propose that OriginSelector is just the default values case of PointSelector: https://github.com/IIIF/api/issues/2253#issuecomment-1916844169

azaroth42 commented 5 months ago

To try and distill the cause of the issue: The difference between the scenes and canvases is that scenes are boundless whereas canvases are bounded, and thus scaling is conceivable for canvases but impossible for scenes. When we target the entire canvas we mean "the bounding box that starts at 0,0 and extends to width,height, and covers the entire duration of the canvas". Then when we paint something onto the canvas, we mean scale into that space.

However, when we target the Scene, we do not want to scale into the space, we want to translate content "pixels" into scene "pixels". It's more like the temporal scaling of AV material into a canvas (c.f. timeMode) where the default is to render at 'normal' speed, and that can be changed if needed.

Perhaps it's that the exception is 2d content painting, rather than the other way round?

azaroth42 commented 5 months ago

Use case: Ambient Lights and Directional Lights are painted into the scene, but not at any particular point. Thus it seems like the annotation targets the Scene as a whole, not the origin (which would make them not Ambient/Directional, but a Point or Spot Light)

azaroth42 commented 5 months ago

Ready for Eds I think