LuciadCPillar C# 2025.0.07
Luciad.Cameras.PerspectiveCamera Class Reference

A camera that uses an perspective projection. More...

Inheritance diagram for Luciad.Cameras.PerspectiveCamera:
Luciad.Cameras.Camera

Classes

class  Builder
 Factory object that can create new PerspectiveCamera instances. More...
 

Public Member Functions

Luciad.Cameras.PerspectiveCamera.Builder AsBuilder ()
 Returns a Builder that is initially configured to build cameras identical to this camera. More...
 
Luciad.Cameras.Camera.Look AsLook ()
 Returns the position and orientation of the camera. More...
 
Luciad.Cameras.Camera.LookAt AsLookAt (double distance)
 Returns a LookAt that matches the position and orientation of this camera. More...
 
Luciad.Cameras.Camera.LookFrom AsLookFrom ()
 Returns a LookFrom that matches the position and orientation of this camera. More...
 
- Public Member Functions inherited from Luciad.Cameras.Camera
void Dispose ()
 
virtual Luciad.Cartesian.Coordinate MapToView (Luciad.Cartesian.Coordinate mapPoint)
 Transforms a point in map coordinates to view coordinates. More...
 
virtual Luciad.Cartesian.Coordinate ViewToMap (Luciad.Cartesian.Coordinate viewPoint)
 Transforms a view point to map coordinates. More...
 

Properties

Luciad.Cartesian.Angle FovY [get]
 The vertical field of view of the camera. More...
 
- Properties inherited from Luciad.Cameras.Camera
Luciad.Cartesian.Coordinate Eye [get]
 The current location of the camera in map coordinates. More...
 
double Far [get]
 The distance from the eye to the far clipping plane. More...
 
Luciad.Cartesian.Coordinate Forward [get]
 The (normalized) direction corresponding to the forward direction of the view. More...
 
double Height [get]
 The height in device independent pixels of the viewport of this camera. More...
 
double Near [get]
 The distance from the eye to the near clipping plane. More...
 
Luciad.Cartesian.Coordinate Up [get]
 The (normalized) direction corresponding to the upward direction of the view. More...
 
double Width [get]
 The width in device independent pixels of the viewport of this camera. More...
 

Detailed Description

A camera that uses an perspective projection.

Also known as a pinhole camera.

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 cameras (OrthographicCamera vs PerspectiveCamera) or other (types of) map references (projected vs. geocentric).

A camera transforms points from the map reference to the view (device independent pixel coordinates).

Besides the position, orientation and size properties that it inherits from Camera, the perspective camera defines its projection using a field of view: the angle, in degrees, that determines the vertical viewing angle of the camera. The horizontal field-of-view angle can be derived from the vertical field-of-view and the camera's aspect ratio.

Perspective Camera

Cameras in LuciadCPillar are immutable. You can manipulate the map's camera by creating a modified copy using the builder. The new camera can then be set on the map.

Currently, the PerspectiveCamera is only used in combination with geocentric (3D) map references (aka 3D maps). For now, you cannot use this camera if the map has a projected (grid) reference.

To manipulate a perspective camera in a geocentric reference, consider using LookAt or LookFrom. This allows you to reason about the camera in terms of yaw (angle from north direction), pitch (angle wrt. horizon) and roll. You could also just manipulate the camera's eye position and forward/up directions directly, if that's a better fit for your use case.

Map navigation constraints configured on MapNavigator are not enforced when this camera is updated on the map. Constraints are only respected when using MapNavigator.

Example:

// low-level manipulation of perspective camera: put camera looking over Europe, faced towards the north
var perspectiveCamera = map.Camera as PerspectiveCamera;
Camera.Look newCameraPosition = new Camera.Look(
new Coordinate(6214861.581912037, 710226.7751339739, 4927634.769711619),
new Coordinate(0.9588725076044676, -0.12713997961061635, -0.25376946180526144),
new Coordinate(-0.2469197372006221, -0.06727846255744102, 0.9666976010400992)
);
Camera newCamera = perspectiveCamera.AsBuilder().Look(newCameraPosition).Build();
// ...
// Set the camera on the map, for example by using Map.AnimationManager
map.Camera = newCamera;
A camera transforms points from the map reference to view coordinates (device independent pixel coord...
Definition: Camera.cs:48
A camera that uses an perspective projection.
Definition: PerspectiveCamera.cs:35
Structure describing the position and orientation of the camera.
Definition: Camera.cs:87
Since
2021.1

Member Function Documentation

◆ AsBuilder()

Luciad.Cameras.PerspectiveCamera.Builder Luciad.Cameras.PerspectiveCamera.AsBuilder ( )
inline

Returns a Builder that is initially configured to build cameras identical to this camera.

You can then change a subset of the camera properties using this builder to create a new camera.

Returns
a Builder that is initially configured to build cameras identical to this camera.

◆ AsLook()

Luciad.Cameras.Camera.Look Luciad.Cameras.PerspectiveCamera.AsLook ( )
inline

Returns the position and orientation of the camera.

Returns
the position and orientation of the camera.

◆ AsLookAt()

Luciad.Cameras.Camera.LookAt Luciad.Cameras.PerspectiveCamera.AsLookAt ( double  distance)
inline

Returns a LookAt that matches the position and orientation of this camera.

Returns
a LookAt that matches the position and orientation of this camera.

◆ AsLookFrom()

Luciad.Cameras.Camera.LookFrom Luciad.Cameras.PerspectiveCamera.AsLookFrom ( )
inline

Returns a LookFrom that matches the position and orientation of this camera.

Returns
a LookFrom that matches the position and orientation of this camera.

Property Documentation

◆ FovY

Luciad.Cartesian.Angle Luciad.Cameras.PerspectiveCamera.FovY
get

The vertical field of view of the camera.

[get]

Returns the vertical field of view of the camera.

See also
PerspectiveCamera.Builder.FovY