IIIF / api

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

Clarify transform applied to camera and light in 3D draft #2288

Open vincentmarchetti opened 5 months ago

vincentmarchetti commented 5 months ago

Propose that for annotations that add camera to a scene (reference https://github.com/IIIF/3d/blob/main/temp-draft-4.md#cameras ) that when the annotation body is a SpecificResource, with transform that sets the camera direction, the transform be limited to RotateTransform resources only. The annotation target can, with a PointSelector wrapped in a SpecificResource, be used to locate the PerspectiveCamera ; the OrthographicCamera does not have a location.

Similarly, for the annotations that add a light that has a directional quality, SpotLight and Directionallight, ( https://github.com/IIIF/3d/blob/main/temp-draft-4.md#lights ) a SpecificResource that defines direction contain only RotateTransform resources, and a Spotlight position determined entirely by the PointSelector applied in the annotation.target resource

JulieWinchester commented 5 months ago

I think it makes sense to restrict cameras and some lights to certain applicable subsets of transforms, and specifically for cameras, I agree with the idea of restricting them to RotateTransform only.

Orthographic cameras should have a position location, though, with that position affecting level of zoom, what can be seen through the viewport, etc.

https://upload.wikimedia.org/wikipedia/commons/c/ce/Orthographic_view_frustum.png

I think this image shows how I'm thinking about orthographic camera position. If the camera position is at the origin in the image, n (near distance) away from the near plane of the frustum, then moving that position away from the origin will affect what is visible within the frustum, with movement along X or Y creating "pans" and movement along Z creating "zoom".

vincentmarchetti commented 5 months ago

I agree with the reply that a position is required to specify the viewport of an orthographic camera, and with the explanation that X and Y changes produce pan effects. I don' think orthographic camera properly implemented would exhibit the zoom effect; the zoom, or an object taking up more of the viewport as you approach it , is a perspective effect and orthographic cameras are used when perspective 'distortions' are not desirable.

I propose that the position of an orthographic camera be specified by a Specific Resource & PositionSelector on the annotation target, and the direction of the light be determined by RotateTransform in the SpecificResource at the annotation body. I also propose that the API document require that for an orthographic camera there is no concept of being 'behind the camera' regardless of its position.

On reviewing this comment and the figure https://upload.wikimedia.org/wikipedia/commons/c/ce/Orthographic_view_frustum.png I realize that the figure implies there should be a concept of "behind the camera". So, I realize this is a topic for discussion.