LuciadCPillar C# 2026.1.02
Loading...
Searching...
No Matches
Luciad.Cameras.PerspectiveCamera.Builder Class Referencesealed

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

Inheritance diagram for Luciad.Cameras.PerspectiveCamera.Builder:

Public Member Functions

 Builder (Luciad.Cameras.PerspectiveCamera.Builder other)
 Copy constructor.
Luciad.Cameras.PerspectiveCamera Build ()
 Returns a new perspective camera.
void Dispose ()
Luciad.Cameras.PerspectiveCamera.Builder Eye (Luciad.Cartesian.Coordinate eye)
 Sets the eye the position of the new camera.
Luciad.Cameras.PerspectiveCamera.Builder FovY (Luciad.Cartesian.Angle fovY)
 Sets the vertical field of view.
Luciad.Cameras.PerspectiveCamera.Builder Look (Luciad.Cameras.Camera.Look look)
 Sets the position and orientation of the new camera.
Luciad.Cameras.PerspectiveCamera.Builder LookAt (Luciad.Cameras.Camera.LookAt lookAt)
 Sets the description of what the camera is looking at and the orientation of the camera.
Luciad.Cameras.PerspectiveCamera.Builder LookFrom (Luciad.Cameras.Camera.LookFrom lookFrom)
 Sets the description of the position and orientation of the new camera.
Luciad.Cameras.PerspectiveCamera.Builder NearFar (double nearPlane, double farPlane)
 Sets the near and far clipping distances of the new camera.
Luciad.Cameras.PerspectiveCamera.Builder Orientation (Luciad.Cartesian.Coordinate forward, Luciad.Cartesian.Coordinate up)
 Sets the forward the viewing direction of the new camera and the camera's up direction.

Detailed Description

Factory object that can create new PerspectiveCamera instances.

Constructor & Destructor Documentation

◆ Builder()

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

Copy constructor.

Parameters
otherthe builder to copy.

Member Function Documentation

◆ Build()

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

Returns a new perspective camera.

Returns
a new perspective camera.

◆ Dispose()

void Luciad.Cameras.PerspectiveCamera.Builder.Dispose ( )
inline

◆ Eye()

Luciad.Cameras.PerspectiveCamera.Builder Luciad.Cameras.PerspectiveCamera.Builder.Eye ( Luciad.Cartesian.Coordinate eye)
inline

Sets the eye the position of the new camera.

Parameters
eyethe position of the new camera.
Returns
this builder

◆ FovY()

Luciad.Cameras.PerspectiveCamera.Builder Luciad.Cameras.PerspectiveCamera.Builder.FovY ( Luciad.Cartesian.Angle fovY)
inline

Sets the vertical field of view.

Note
The horizontal field of view will be derived from vertical field of view based on the aspect ratio. You can convert between horizontal and vertical field-of-view angles using the following formulae:
// Vertical -> horizontal field-of-view
double aspectRatio = (double)(camera.Width) / camera.Height;
Angle cameraFovX = Angle.FromRadians(2.0 * Math.Atan(Math.Tan(camera.FovY.Radians / 2.0) * aspectRatio));
// Horizontal -> vertical field-of-view
Angle newFovX = 60.0;
Angle newFovY = Angle.FromRadians(2 * Math.Atan(Math.Tan(newFovX.Radians / 2.0) / aspectRatio));
Parameters
fovYthe new vertical field of view.
Returns
this builder

◆ Look()

Luciad.Cameras.PerspectiveCamera.Builder Luciad.Cameras.PerspectiveCamera.Builder.Look ( Luciad.Cameras.Camera.Look look)
inline

Sets the position and orientation of the new camera.

Parameters
lookthe position and orientation of the new camera.
Returns
this builder

◆ LookAt()

Luciad.Cameras.PerspectiveCamera.Builder Luciad.Cameras.PerspectiveCamera.Builder.LookAt ( Luciad.Cameras.Camera.LookAt lookAt)
inline

Sets the description of what the camera is looking at and the orientation of the camera.

Parameters
lookAtthe description of what the camera is looking at and the orientation of the camera.
Returns
this builder

◆ LookFrom()

Luciad.Cameras.PerspectiveCamera.Builder Luciad.Cameras.PerspectiveCamera.Builder.LookFrom ( Luciad.Cameras.Camera.LookFrom lookFrom)
inline

Sets the description of the position and orientation of the new camera.

Parameters
lookFromthe description of the position and orientation of the new camera.
Returns
this builder

◆ NearFar()

Luciad.Cameras.PerspectiveCamera.Builder Luciad.Cameras.PerspectiveCamera.Builder.NearFar ( double nearPlane,
double farPlane )
inline

Sets the near and far clipping distances of the new camera.

These values only take effect when the map's automatic near/far adjustment is turned off (see Map.setAutoAdjustDepthRangeEnabled).

Note that choosing a range that is too wide can introduce depth artifacts. Choosing a range that is too narrow can clip parts of the visible object, or even clip it away completely.

Both distances are in the units of the map reference (meters for a geocentric reference). The near plane must be positive and smaller than the far plane.

Guidelines for choosing a range:

  • Depth precision is governed by the far to near ratio, not by the absolute values. Very large ratios make distant surfaces z-fight, so keep the ratio as small as the scene allows (up to the order of 1e5 is usually fine).
  • Push the near plane as far from the eye as you can without clipping the closest geometry you care about. The near plane dominates precision, so a needlessly small one wastes precision over the whole range.
  • Pull the far plane in to just beyond the farthest geometry that has to stay visible.
  • Prefer deriving both from the distance between the eye and what you are looking at, rather than fixed values, so the range tracks the scene as you zoom.

Example ranges for a geocentric (meters) map, with an earth radius of about 6.378e6:

  • Close to the ground, inspecting buildings (eye a few hundred meters up): near about 1, far about 1e5.
  • Regional view (eye tens of kilometers up): near about 1e2, far about 1e6.
  • Whole-earth view (eye a couple of earth radii out): near about 1e5, far about 5e7, reaching the far side of the globe.
Parameters
nearPlanethe distance from the eye to the near clipping plane.
farPlanethe distance from the eye to the far clipping plane.
Returns
this builder
Since
2026.1

◆ Orientation()

Luciad.Cameras.PerspectiveCamera.Builder Luciad.Cameras.PerspectiveCamera.Builder.Orientation ( Luciad.Cartesian.Coordinate forward,
Luciad.Cartesian.Coordinate up )
inline

Sets the forward the viewing direction of the new camera and the camera's up direction.

Parameters
forwardthe viewing direction of the new camera
upthe camera's up direction
Returns
this builder