Struct ViewSpacePoint
A projected point in the view's camera frame, before the perspective divide, in the same pixel units TryProjectWithAltitude(MercatorPoint, double, out ScreenPoint) works in.
public readonly struct ViewSpacePoint
- Inherited Members
Remarks
Screen position is X * CameraDistance / Depth (horizontal) and
Y * CameraDistance / Depth (vertical) plus the screen center -
the divide TryProjectWithAltitude(MercatorPoint, double, out ScreenPoint)
applies after its own guards. This type carries the three quantities
that divide feeds on, so a caller that does not need a screen pixel -
placing a world-space object at the point instead - can skip the
divide entirely and stay finite for a point behind the camera or past
the far view-distance cap, where the divide either blows up or
disagrees with the map's own drawn ground.
Constructors
ViewSpacePoint(double, double, double, double)
Creates a view-space point.
public ViewSpacePoint(double x, double y, double depth, double cameraDistance)
Parameters
xdoubleHorizontal camera-frame position in screen px, before the divide.
ydoubleVertical camera-frame position in screen px, up-positive, before the divide.
depthdoubleDistance along the view axis in screen px, larger further from the camera; cameraDistance is the camera's own distance in the same units.
cameraDistancedoubleThe view's camera distance in screen px, matching
depth's units.
Properties
CameraDistance
The view's camera distance in screen px, matching Depth's units.
public double CameraDistance { get; }
Property Value
Depth
Distance along the view axis in screen px. At or below 0 the point is at or behind the camera plane; large values are far toward the horizon, past where the map draws ground.
public double Depth { get; }
Property Value
X
Horizontal camera-frame position in screen px, before the divide.
public double X { get; }
Property Value
Y
Vertical camera-frame position in screen px, up-positive, before the divide.
public double Y { get; }