api icon indicating copy to clipboard operation
api copied to clipboard

Added field size property to OrthographicCamera

Open vincentmarchetti opened this issue 1 year ago • 7 comments

The PerspectiveCamera has a property fieldOfView as illustrated in the figure in https://github.com/IIIF/3d/blob/main/temp-draft-4.md#lights . In the limiting case of moving a PerspectiveCamera out to infinite distance and narrowing the fieldOfView to 0, giving an OrthographicCamera, we need a replacement property which is a linear dimension, for example "3" representing 3 meters. By analogy with the fieldOfView definition, this linear dimension would be the vertical dimension of the viewport in the orthographic projection.

vincentmarchetti avatar Apr 17 '24 15:04 vincentmarchetti

I think I agree with this, although like I said in #2288 orthographic cameras should definitely be able to have a position and so should not need to be moved out to infinite distance. But orthographic cameras probably need something to determine the distance between top and bottom frustum planes.

JulieWinchester avatar Apr 17 '24 15:04 JulieWinchester

Eds agree -- add height to the OrthographicCamera to mirror the vertical field of view on PerspectiveCamera

azaroth42 avatar Jun 07 '24 19:06 azaroth42

There is a name collision between this property of an OrthographicCamera resource and a property of same name in several resources types defined in Presentation 3 -- for example. Canvas. This naming does not cause any problems in, for example, the manifesto javascript library. Is this choice of names intentional for that reason?

vincentmarchetti avatar Jun 11 '24 21:06 vincentmarchetti

If term collision is an issue, maybe viewHeight?

kirschbombe avatar Jun 11 '24 21:06 kirschbombe

height of a Canvas or content resource (like an image or video) is an abstract "height" rather than a number of pixels.

That said, if we want to use the Value format for this that has both numeric value and unit, it would need to be different as height is explicitly just the numeric value.

azaroth42 avatar Jun 11 '24 21:06 azaroth42

Turns out the name collision does cause problems in the Typescript (strongly typed) language implementation of manifesto.Could be resolved with tinkering of the manifesto code, which is not really an issue for the editors to consider. However, it seems that in the 2D presentation API, Height , and WIdth, are fundamental properties of a number of the resource types, all with related meaning. It may not be a good idea to give a 3D resource a property of that name but with incompatible meaning.

vincentmarchetti avatar Jun 13 '24 21:06 vincentmarchetti

We will add viewHeight to Orthographic Camera, that must be float.

NB - this is not to avoid a collision - just a better name.

tomcrane avatar Mar 17 '25 18:03 tomcrane