Creates a new OrthographicCamera
the 3D position that the camera is looking from, in world coordinates.
The 3D direction the camera is looking in, in world coordinates. The combination of the forward and up vector determines the orientation of the camera.
The 3D direction that indicates the 'up' direction of the camera, in world coordinates. The combination of the forward and up vector determines the orientation of the camera, in world space.
The distance from the eye
to the near clipping plane.
Points that fall outside of the near/far interval, are clipped.
Note that the near plane distance can be negative.
The distance from the eye
to the far clipping plane.
Points that fall outside of the near/far interval, are clipped.
The width, in pixels, of the camera's viewport.
The height, in pixels, of the camera's viewport.
The size of the viewport along the X (horizontal) direction, in world units.
The size of the viewport along the Y (vertical) direction, in world units.
The reference in which
eye
, forward
, up
, near
,
far
are defined (as well as the world units referred to in
scaleX
and scaleY
).
The world distance from the eye
to the far clipping plane.
Points that fall outside of the near/far interval, are clipped.
By default, this gets updated automatically on a 3D Map, to keep the earth's surface visible.
See WebGLMap.adjustDepthRange for more information.
The height, in pixels, of the camera's viewport.
The world distance from the eye
to the near clipping plane.
Points that fall outside of the near/far interval, are clipped.
By default, this gets updated automatically on a 3D Map, to keep the earth's surface visible.
See WebGLMap.adjustDepthRange for more information.
Note that the near plane distance can be negative.
The width, in pixels, of the camera's viewport.
The size of the viewport along the Y (vertical) direction, in world units.
The coordinate reference in which the camera is positioned and oriented.
The size of the viewport along the X (horizontal) direction, in world units.
Returns a look2d object that matches this camera's position and orientation. This look2D object makes it easier to work with '2D' cameras (Orthographic camera's with a projected (grid) or cartesian reference). Once retrieved, this look2D can be manipulated and then set on the map again using look2D
<p>Note that this will only work if this camera's <a href="_luciad_ria_view_camera_OrthographicCamera.OrthographicCamera.html#worldReference" class="tsd-kind-accessor">worldReference</a> is a projected (grid) or cartesian reference.</p>
A Look2D object that matches this camera's position and orientation.
Returns a LookAt that matches the position and orientation of this camera.
Note you can only use this function if this camera's worldReference is not a 2D reference.
a distance (in the world reference's unit) between the camera's position and the LookAt's ref. For geocentric references, the world unit is usually 1 meter.
a LookAt object that matches position and orientation of this camera.
2023.1
Returns a LookFrom that matches the position and orientation of this camera.
Note you can only use this function if this camera's worldReference is not a 2D reference.
// keep looking from the same point, but pitch the view up 10 degrees
var lookFrom = map.camera.asLookFrom();
lookFrom.pitch += 10;
map.camera = map.camera.lookFrom(lookFrom);
a LookFrom object that matches position and orientation of this camera.
2023.1
Returns copy of this camera.
A copy of this camera
Copies this camera, and overrides parameters on the copy.
Optional
options: OrthographicCameraOptionsCamera parameters to override while copying. The returned copy will have the values of this Camera's parameters, except for the parameters defined in the options argument.
A copy of the current camera, with the parameters defined in the options overridden.
Returns a new OrthographicCamera, which is positioned and oriented as described by the look2d object. This look2D object makes it easier to work with '2D' cameras (Orthographic camera's with a projected (grid) or cartesian reference). You can construct a look2D object manually, or retrieve it from an existing camera using asLook2D.
<p>Note that this will only work if this camera's <a href="_luciad_ria_view_camera_OrthographicCamera.OrthographicCamera.html#worldReference" class="tsd-kind-accessor">worldReference</a> is a projected (grid) or cartesian reference.</p>
<p>For convenience, if worldOrigin is a <a href="_luciad_ria_shape_Point.Point.html" class="tsd-kind-class">Point</a>, LuciadRIA will attempt to transform it to the <a href="_luciad_ria_view_camera_OrthographicCamera.OrthographicCamera.html#worldReference" class="tsd-kind-accessor">worldReference</a>.</p>
a Look2D object
A new camera instance that matches the position described by the Look2D object.
// put lon-lat point [12,5] at the center of the view
map.camera.look2D({
viewOrigin: {x: map.camera.width / 2, y: map.camera.height / 2, z: 0},
worldOrigin: createPoint(ReferenceProvider.getReference("CRS:84"), [12, 5]),
scaleX: map.camera.width / map.camera.worldWidth,
scaleY: map.camera.height / map.camera.worldHeight,
rotation: 0
});
Returns a camera that matches the position and orientation of the specified LookAt.
If lookAt.ref
is a Point, then that point will be transformed to
worldReference (if necessary).
Note you can only use this function if this camera's worldReference is not a 2D reference.
map.camera = map.camera.lookAt({
ref: createPoint(getReference("CRS:84"), [52, 2, 0]),
distance: 50e3,
yaw: 180,
pitch: -35,
roll: 0
});
The returned camera will match this LookFrom's position and orientation.
a camera that matches the position and orientation of the LookAt that was passed in.
2023.1
Returns a camera that matches the position and orientation of the specified LookFrom.
If lookFrom.eye
is a Point, then that point will be transformed to
worldReference (if necessary).
Note you can only use this function if this camera's worldReference is not a 2D reference.
To perform a lookFrom with navigation constraints enforced you can use MapNavigator#lookFrom. This call will respect navigations constraints and additionally it can do the operation animated.
map.camera = map.camera.lookFrom({
eye: createPoint(getReference("CRS:84"), [0, 0, 20e3]),
yaw: 180,
pitch: -35,
roll: 0
});
The returned camera will match this LookFrom's position and orientation.
a camera that matches the position and orientation of the LookFrom that was passed in.
2023.1
Transforms a Vector3 from world to view
The world point to transform to view space (pixels).
Optional
vectorSFCT: Vector3An optional 'out' parameter. If this is defined, it's x,y and z properties will be assigned to the result of the transformation. If it's not defined, a new Vector3 with the result is constructed and returned. Use this out parameter if you need to transform many points at once, and want to avoid creating many objects.
The transformed point, in view space (pixels)
Transforms a Point from world to view
The point to transform to view space (pixels). If this point is not defined in this camera's worldReference, it will first be transformed to the worldReference.
Optional
outPointSFCT: PointAn optional 'out' parameter. If this is defined, that point will be moved to the result of the transformation. If it's not defined, a new Point with the result is constructed and returned. Use this out parameter if you need to transform many points at once, and want to avoid creating many Point instances.
The transformed point, in view space (pixels).
Transforms a Vector3 to world.
The view point (pixels) to transform to world space.
Optional
vectorSFCT: Vector3An optional 'out' parameter. If this is defined, it's x,y and z properties will be assigned to the result of the transformation. If it's not defined, a new Vector3 with the result is constructed and returned. Use this out parameter if you need to transform many points at once, and want to avoid creating many objects.
The transformed point, in world space.
Transforms a Point to world.
The point to transform to view space (pixels). A 'view' point has 'null' as its reference.
Optional
outPointSFCT: PointAn optional 'out' parameter. If this is defined, that point will be moved to the result of the transformation. If it is defined, and has a reference other than worldReference, it will be transformed to that reference. If it's not defined, a new Point with the result is constructed and returned. Use this out parameter if you need to transform many points at once, and want to avoid creating many Point instances.
The transformed point, in view space (pixels).
A camera that uses an orthographic (aka. parallel) projection.
Note that the Camera API is a low-level API. For simple map navigation use cases, it's recommended to use the higher-level API. The MapNavigator API works in both 2D and 3D, on all map references. If you use the low-level Camera API, keep in mind that the same camera manipulation implementation might not work for other types of camera's (OrthographicCamera vs PerspectiveCamera) or other (types of) map references (projected vs. geocentric).
A camera transforms points from the 'world' reference (often the map's reference) to the view (pixel coordinates).
Besides the position, orientation and viewport properties that it inherits from Camera, the orthographic camera defines its projection using the following properties:
Note that camera's in LuciadRIA are immutable. You can manipulate the map's camera by using Look2D, lookAt or lookFrom. The last two only work if the camera's worldReference is a 3D reference.
Currently, the OrthographicCamera can only be used in combination with projected (grid) or cartesian map references. For now, you can not use this camera if the map has a geocentric reference.
For projected (grid) or 2D cartesian references, the camera should be positioned along the positive Z axis, facing the negative Z direction. This way, the camera is positioned facing the XY-plane, where the map is rendered in.
To manipulate an orthographic camera on a projected (grid) or 2D cartesian reference, we recommend using look2D. This allows you to reason about the camera in 2D space, instead of a 3D space. It also allows you to easily rotate and zoom the camera around any arbitrary view / world point.
Map navigation constraints configured on MapNavigator are not enforced when this camera is updated on the map. Constraints are only respected when using the MapNavigator.