[Serializable] public sealed class ViewportInfo : CommonObject
Represents a viewing frustum.

Constructors

ViewportInfo

#Since v5.0
Initializes a new instance.
public ViewportInfo()

ViewportInfo

#Since v5.0
Copies all of the ViewportInfo data from an existing RhinoViewport.
public ViewportInfo(
rhinoViewport
A viewport to copy.
)

ViewportInfo

#Since v5.0
Initializes a new instance by copying values from another instance.
public ViewportInfo(
ViewportInfo
other
The other viewport info.
)

Properties

Camera35mmLensLength

#Since v5.0
This property assumes the camera is horizontal and crop the film rather than the image when the aspect of the frustum is not 36/24. (35mm film is 36mm wide and 24mm high.) Setting preserves camera location, changes the frustum, but maintains the frustum's aspect.
public double Camera35mmLensLength { get; set; }

CameraAngle

#Since v5.0
Gets or sets the 1/2 of smallest subtended view angle. See GetCameraAngles(double, double, double) for more information.
public double CameraAngle { get; set; }

CameraDirection

#Since v5.0
Gets the direction that the camera faces.
public Vector3d CameraDirection { get; }

CameraLocation

#Since v5.0
Gets the camera location (position) point.
public Point3d CameraLocation { get; }

CameraUp

#Since v5.0
Gets the camera up vector.
public Vector3d CameraUp { get; }

CameraX

#Since v5.0
Gets the unit "to the right" vector.
public Vector3d CameraX { get; }

CameraY

#Since v5.0
Gets the unit "up" vector.
public Vector3d CameraY { get; }

CameraZ

#Since v5.0
Gets the unit vector in -CameraDirection.
public Vector3d CameraZ { get; }

DefaultCameraDirection

#Since v6.0
Default z=up perspective camera direction
public static Vector3d DefaultCameraDirection { get; }

Disposed

Indicates if this object has been disposed or the document it originally belonged to has been disposed.
public bool Disposed { get; }
inherited fromCommonObject

FrustumAspect

#Since v5.0
Setting FrustumAspect changes the larger of the frustum's width/height so that the resulting value of width/height matches the requested aspect. The camera angle is not changed. If you change the shape of the view port with a call SetScreenPort(), then you generally want to call SetFrustumAspect() with the value returned by GetScreenPortAspect().
public double FrustumAspect { get; set; }

FrustumBottom

#Since v5.0
Gets the frustum bottom value. This is -top if the frustum has a horizontal symmetry axis.

This number is usually negative.

public double FrustumBottom { get; }

FrustumBottomPlane

#Since v5.0
Gets the frustum bottom plane that separates visible from off-screen.
public Plane FrustumBottomPlane { get; }

FrustumCenter

#Since v5.0
Gets the frustum center point.
public Point3d FrustumCenter { get; }

FrustumFar

#Since v5.0
Gets the frustum far-cutting value.
public double FrustumFar { get; }

FrustumFarPlane

#Since v5.0
Gets far clipping plane if camera and frustum are valid. The plane's frame is the same as the camera's frame. The origin is located at the intersection of the camera direction ray and the far clipping plane. The plane's normal points into the frustum towards the camera location.
public Plane FrustumFarPlane { get; }

FrustumHeight

#Since v5.0
Gets the frustum height. This is FrustumTop - FrustumBottom.
public double FrustumHeight { get; }

FrustumLeft

#Since v5.0
Gets the frustum left value. This is -right if the frustum has a vertical symmetry axis.

This number is usually negative.

public double FrustumLeft { get; }

FrustumLeftPlane

#Since v5.0
Gets the frustum left plane that separates visible from off-screen.
public Plane FrustumLeftPlane { get; }

FrustumMaximumDiameter

#Since v5.0
Gets the frustum maximum diameter, or the maximum between FrustumWidth and FrustumHeight.
public double FrustumMaximumDiameter { get; }

FrustumMinimumDiameter

#Since v5.0
Gets the frustum minimum diameter, or the minimum between FrustumWidth and FrustumHeight.
public double FrustumMinimumDiameter { get; }

FrustumNear

#Since v5.0
Gets the frustum near-cutting value.
public double FrustumNear { get; }

FrustumNearPlane

#Since v5.0
Gets near clipping plane if camera and frustum are valid. The plane's frame is the same as the camera's frame. The origin is located at the intersection of the camera direction ray and the near clipping plane. The plane's normal points out of the frustum towards the camera location.
public Plane FrustumNearPlane { get; }

FrustumRight

#Since v5.0
Gets the frustum right value. This is -left if the frustum has a vertical symmetry axis.

This number is usually positive.

public double FrustumRight { get; }

FrustumRightPlane

#Since v5.0
Gets the frustum right plane that separates visible from off-screen.
public Plane FrustumRightPlane { get; }

FrustumTop

#Since v5.0
Gets the frustum top value. This is -bottom if the frustum has a horizontal symmetry axis.

This number is usually positive.

public double FrustumTop { get; }

FrustumTopPlane

#Since v5.0
Gets the frustum top plane that separates visible from off-screen.
public Plane FrustumTopPlane { get; }

FrustumWidth

#Since v5.0
Gets the frustum width. This is FrustumRight - FrustumLeft.
public double FrustumWidth { get; }

HasUserData

Gets true if this class has any custom information attached to it through UserData.
public bool HasUserData { get; }
inherited fromCommonObject

Id

#Since v5.0
Sets the viewport's id to the value used to uniquely identify this viewport. There is no approved way to change the viewport id once it is set in order to maintain consistency across multiple viewports and those routines that manage them.
public Guid Id { get; set; }

IsCameraDirectionLocked

#Since v5.0
Gets or sets a value that indicates whether the direction that the camera faces is unmodifiable.
public bool IsCameraDirectionLocked { get; set; }

IsCameraLocationLocked

#Since v5.0
Gets or sets a value that indicates whether the camera location is unmodifiable.
public bool IsCameraLocationLocked { get; set; }

IsCameraUpLocked

#Since v5.0
Gets or sets a value that indicates whether the camera up vector is unmodifiable.
public bool IsCameraUpLocked { get; set; }

IsDocumentControlled

If true this object may not be modified. Any properties or functions that attempt to modify this object when it is set to "IsReadOnly" will throw a NotSupportedException.
public virtual bool IsDocumentControlled { get; }
inherited fromCommonObject

IsFrustumLeftRightSymmetric

#Since v5.0
Gets or sets a value that indicates whether the camera frustum has a vertical symmetry axis.
public bool IsFrustumLeftRightSymmetric { get; set; }

IsFrustumTopBottomSymmetric

#Since v5.0
Gets or sets a value that indicates whether the camera frustum has a horizontal symmetry axis.
public bool IsFrustumTopBottomSymmetric { get; set; }

IsParallelProjection

#Since v5.0
Get or set whether this projection is parallel.
public bool IsParallelProjection { get; set; }

IsPerspectiveProjection

#Since v5.0
Get or set whether this projection is perspective.
public bool IsPerspectiveProjection { get; set; }

IsTwoPointPerspectiveProjection

#Since v5.0
Gets a value that indicates whether this projection is a two-point perspective.
public bool IsTwoPointPerspectiveProjection { get; }

IsValid

Tests an object to see if it is valid.
public virtual bool IsValid { get; }
inherited fromCommonObject

IsValidCamera

#Since v5.0
Gets a value that indicates whether the camera is valid.
public bool IsValidCamera { get; }

IsValidFrustum

#Since v5.0
Gets a value that indicates whether the frustum is valid.
public bool IsValidFrustum { get; }

PerspectiveMinNearDist

#Since v7.0
Expert user function to control the minimum value of near when perspective projections are being used.
public double PerspectiveMinNearDist { get; set; }

PerspectiveMinNearOverFar

#Since v7.0
Expert user function to control the minimum ratio of near/far when perspective projections are begin used.
public double PerspectiveMinNearOverFar { get; set; }

ScreenPort

#Since v6.0
Get or set the screen port. SetScreenPort(Rectangle) and GetScreenPort()
public Rectangle ScreenPort { get; set; }

ScreenPortAspect

#Since v5.0
Gets the screen aspect ratio.

This is width / height.

public double ScreenPortAspect { get; }

TargetPoint

#Since v5.0
The current value of the target point. This point does not play a role in the view projection calculations. It can be used as a fixed point when changing the camera so the visible regions of the before and after frustums both contain the region of interest. The default constructor sets this point on ON_3dPoint::UnsetPoint. You must explicitly call one SetTargetPoint() functions to set the target point.
public Point3d TargetPoint { get; set; }

UserData

List of custom information that is attached to this class.
public UserDataList UserData { get; }
inherited fromCommonObject

UserDictionary

Dictionary of custom information attached to this class. The dictionary is actually user data provided as an easy to use shareable set of information.
public ArchivableDictionary UserDictionary { get; }
inherited fromCommonObject

ViewScale

#Since v5.0
Applies scaling factors to parallel projection clipping coordinates by setting the m_clip_mod transformation. If you want to compress the view projection across the viewing plane, then set x = 0.5, y = 1.0, and z = 1.0.
public SizeF ViewScale { get; set; }

Methods

CalculateCameraRotationAngle

#Since v6.8
Calculates the camera rotation angle.
public static double CalculateCameraRotationAngle(
direction,
The camera direction.
up
The camera up direction.
)
The camera rotation angle in radians.

CalculateCameraUpDirection

#Since v6.8
Calculates the camera up direction.
public static Vector3d CalculateCameraUpDirection(
location,
The camera location.
direction,
The camera direction.
angle
The camera rotation angle in radians.
)
The camera up direction.

ChangeToParallelProjection

#Since v5.0
Use this function to change projections of valid viewports from parallel to perspective. It will make common additional adjustments to the frustum and camera location so the resulting views are similar. The camera direction and target point are not be changed. If the current projection is parallel and symmetricFrustum, FrustumIsLeftRightSymmetric() and FrustumIsTopBottomSymmetric() are all equal, then no changes are made and true is returned.
public bool ChangeToParallelProjection(
symmetricFrustum
true if you want the resulting frustum to be symmetric.
)
true if the operation succeeded; otherwise, false.

ChangeToParallelReflectedProjection

#Since v8.14
When a viewport is set to Parallel Reflected projection, the geometry on the ceiling is shown as if it is mirrored to the floor below.
public bool ChangeToParallelReflectedProjection()
true if successful

ChangeToPerspectiveProjection

#Since v5.0
Use this function to change projections of valid viewports from parallel to perspective. It will make common additional adjustments to the frustum and camera location so the resulting views are similar. The camera direction and target point are not changed. If the current projection is perspective and symmetricFrustum, IsFrustumIsLeftRightSymmetric, and IsFrustumIsTopBottomSymmetric are all equal, then no changes are made and true is returned.
public bool ChangeToPerspectiveProjection(
targetDistance,
If RhinoMath.UnsetValue this parameter is ignored. Otherwise it must be > 0 and indicates which plane in the current view frustum should be preserved.
symmetricFrustum,
true if you want the resulting frustum to be symmetric.
lensLength
(pass 50.0 when in doubt) 35 mm lens length to use when changing from parallel to perspective projections. If the current projection is perspective or lens_length is <= 0.0, then this parameter is ignored.
)
true if the operation succeeded; otherwise, false.

ChangeToSymmetricFrustum

#Since v5.0
If needed, adjusts the current frustum so it has the specified symmetries and adjust the camera location so the target plane remains visible.
public bool ChangeToSymmetricFrustum(
isLeftRightSymmetric,
If true, the frustum will be adjusted so left = -right.
isTopBottomSymmetric,
If true, the frustum will be adjusted so top = -bottom.
targetDistance
If projection is not perspective or target_distance is RhinoMath.UnsetValue, then this parameter is ignored. If the projection is perspective and targetDistance is not RhinoMath.UnsetValue, then it must be > 0.0 and it is used to determine which plane in the old frustum will appear unchanged in the new frustum.
)
Returns true if the viewport has now a frustum with the specified symmetries.

ChangeToTwoPointPerspectiveProjection

#Since v5.0
Changes projections of valid viewports to a two point perspective. It will make common additional adjustments to the frustum and camera location and direction so the resulting views are similar. If the current projection is perspective and IsFrustumIsLeftRightSymmetric is true and IsFrustumIsTopBottomSymmetric is false, then no changes are made and true is returned.
public bool ChangeToTwoPointPerspectiveProjection(
targetDistance,
If RhinoMath.UnsetValue this parameter is ignored. Otherwise it must be > 0 and indicates which plane in the current view frustum should be preserved.
up,
The locked up direction. Pass Vector3d.Zero if you want to use the world axis direction that is closest to the current up direction. Pass CameraY() if you want to preserve the current up direction.
lensLength
(pass 50.0 when in doubt) 35 mm lens length to use when changing from parallel to perspective projections. If the current projection is perspective or lens_length is <= 0.0, then this parameter is ignored.
)
true if the operation succeeded; otherwise, false.

ConstructConstObject

Assigns a parent object and a sub-object index to this.
protected void ConstructConstObject(
parentObject,
The parent object.
subobjectIndex
The sub-object index.
)
inherited fromCommonObject

Dispose

Actively reclaims unmanaged resources that this instance uses.
public void Dispose()
inherited fromCommonObject

Dispose

For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

protected virtual void Dispose(
disposing
true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.
)
inherited fromCommonObject

DollyCamera

#Since v5.0
DollyCamera() does not update the frustum's clipping planes. To update the frustum's clipping planes call DollyFrustum(d) with d = dollyVector o cameraFrameZ. To convert screen locations into a dolly vector, use GetDollyCameraVector(). Does not update frustum. To update frustum use DollyFrustum(d) with d = dollyVector o cameraFrameZ.
public bool DollyCamera(
dollyVector
dolly vector in world coordinates.
)
true if the operation succeeded; otherwise, false.

DollyExtents

#Since v5.6
Dolly the camera location and so that the view frustum contains all of the document objects that can be seen in view. If the projection is perspective, the camera angle is not changed.
public bool DollyExtents(
cameraCoordinateBoundingBox,
border
If border > 1.0, then the frustum is enlarged by this factor to provide a border around the view. If 0.0 < border < 1.0, then the frustum is shrunk by this factor and the objects will extend past the edges of the view. A border of 0.0 or 1.0 adds no border. 1.1 works well for parallel projections; 0.0 is suggested for perspective projections.
)
True if successful.

DollyExtents

#Since v5.6
Dolly the camera location and so that the view frustum contains all of the document objects that can be seen in view. If the projection is perspective, the camera angle is not changed.
public bool DollyExtents(
geometry,
border
If border > 1.0, then the frustum is enlarged by this factor to provide a border around the view. If 0.0 < border < 1.0, then the frustum is shrunk by this factor and the objects will extend past the edges of the view. A border of 0.0 or 1.0 adds no border. 1.1 works well for parallel projections; 0.0 is suggested for perspective projections.
)
True if successful.

DollyFrustum

#Since v5.0
Moves the frustum clipping planes.
public bool DollyFrustum(
dollyDistance
Distance to move in camera direction.
)
true if the operation succeeded; otherwise, false.

EnsurePrivateCopy

If you want to keep a copy of this class around by holding onto it in a variable after a command completes, call EnsurePrivateCopy to make sure that this class is not tied to the document. You can call this function as many times as you want.
public void EnsurePrivateCopy()
inherited fromCommonObject

Extents

#Since v5.0
Extends this viewport view to include a bounding box.

Use Extents() as a quick way to set a viewport to so that bounding volume is inside of a viewports frustum. The view angle is used to determine the position of the camera.

public bool Extents(
halfViewAngleRadians,
1/2 smallest subtended view angle in radians.
bbox
A bounding box in 3d world coordinates.
)
true if the operation succeeded; otherwise, false.

Extents

#Since v5.0
Extends this viewport view to include a sphere.

Use Extents() as a quick way to set a viewport to so that bounding volume is inside of a viewports frustum. The view angle is used to determine the position of the camera.

public bool Extents(
halfViewAngleRadians,
1/2 smallest subtended view angle in radians.
sphere
A sphere in 3d world coordinates.
)
true if the operation succeeded; otherwise, false.

FrustumCenterPoint

#Since v5.0
Return a point on the central axis of the view frustum. This point is a good choice for a general purpose target point.
public Point3d FrustumCenterPoint(
targetDistance
If targetDistance > 0.0, then the distance from the returned point to the camera plane will be targetDistance. Note that if the frustum is not symmetric, the distance from the returned point to the camera location will be larger than targetDistance. If targetDistance == ON_UNSET_VALUE and the frustum is valid with near > 0.0, then 0.5*(near + far) will be used as the targetDistance.
)
A point on the frustum's central axis. If the viewport or input is not valid, then ON_3dPoint::UnsetPoint is returned.

GetBoundingBoxDepth

#Since v5.0
Gets near and far clipping distances of a bounding box. This function ignores the current value of the viewport's near and far settings. If the viewport is a perspective projection, the it intersects the semi infinite frustum volume with the bounding box and returns the near and far distances of the intersection. If the viewport is a parallel projection, it intersects the infinite view region with the bounding box and returns the near and far distances of the projection.
public bool GetBoundingBoxDepth(
bbox,
The bounding box to sample.
out double
nearDistance,
Near distance of the box. This value can be zero or negative when the camera location is inside box.
out double
farDistance
Far distance of the box. This value can be equal to near_dist, zero or negative when the camera location is in front of the bounding box.
)
true if the bounding box intersects the view frustum and near_dist/far_dist were set. false if the bounding box does not intersect the view frustum.

GetCameraAngles

#Since v5.0
Gets the field of view angles.
public bool GetCameraAngles(
out double
halfDiagonalAngleRadians,
1/2 of diagonal subtended angle. This out parameter is assigned during this call.
out double
halfVerticalAngleRadians,
1/2 of vertical subtended angle. This out parameter is assigned during this call.
out double
halfHorizontalAngleRadians
1/2 of horizontal subtended angle. This out parameter is assigned during this call.
)
true if the operation succeeded; otherwise, false.

GetCameraFrame

#Since v5.0
Gets location and vectors of this camera.
public bool GetCameraFrame(
out Point3d
location,
An out parameter that will be filled with a point during the call.
cameraX,
An out parameter that will be filled with the X vector during the call.
cameraY,
An out parameter that will be filled with the Y vector during the call.
cameraZ
An out parameter that will be filled with the Z vector during the call.
)
true if current camera orientation is valid; otherwise false.

GetDollyCameraVector

#Since v5.0
Gets a world coordinate dolly vector that can be passed to DollyCamera().
public Vector3d GetDollyCameraVector(
screenX0,
Screen coordinates of start point.
screenY0,
Screen coordinates of start point.
screenX1,
Screen coordinates of end point.
screenY1,
Screen coordinates of end point.
projectionPlaneDistance
Distance of projection plane from camera. When in doubt, use 0.5*(frus_near+frus_far).
)
The world coordinate dolly vector.

GetDollyCameraVector

#Since v5.0
Gets a world coordinate dolly vector that can be passed to DollyCamera().
public Vector3d GetDollyCameraVector(
screen0,
Start point.
screen1,
End point.
projectionPlaneDistance
Distance of projection plane from camera. When in doubt, use 0.5*(frus_near+frus_far).
)
The world coordinate dolly vector.

GetFarPlaneCorners

#Since v5.0
Gets the corners of far clipping plane rectangle. 4 points are returned in the order of bottom left, bottom right, top left, top right.
public Point3d[] GetFarPlaneCorners()
Four corner points on success. Empty array if viewport is not valid.

GetFramePlaneCorners

#Since v8.0
Gets the corners of the frame plane rectangle at specified depth. 4 points are returned in the order of bottom left, bottom right, top left, top right.
public Point3d[] GetFramePlaneCorners(
depth
Distance from camera location.
)
Four corner points on success. Empty array if viewport is not valid.

GetFrustum

#Since v5.0
Gets the view frustum.
public bool GetFrustum(
out double
left,
A left value that will be filled during the call.
out double
right,
A right value that will be filled during the call.
out double
bottom,
A bottom value that will be filled during the call.
out double
top,
A top value that will be filled during the call.
out double
nearDistance,
A near distance value that will be filled during the call.
out double
farDistance
A far distance value that will be filled during the call.
)
true if operation succeeded; otherwise, false.

GetFrustumLine

#Since v5.1
Gets the world coordinate line in the view frustum that projects to a point on the screen.
public Line GetFrustumLine(
screenX,
(screenx,screeny) = screen location.
screenY
(screenx,screeny) = screen location.
)
3d world coordinate line segment starting on the near clipping plane and ending on the far clipping plane.

GetFrustumLine

#Since v5.1
Gets the world coordinate line in the view frustum that projects to a point on the screen.
public Line GetFrustumLine(
screenPoint
screen location
)
3d world coordinate line segment starting on the near clipping plane and ending on the far clipping plane.

GetFrustumLine

#Since v5.1
Gets the world coordinate line in the view frustum that projects to a point on the screen.
public Line GetFrustumLine(
screenPoint
screen location
)
3d world coordinate line segment starting on the near clipping plane and ending on the far clipping plane.

GetNearPlaneCorners

#Since v5.0
Gets the corners of near clipping plane rectangle. 4 points are returned in the order of bottom left, bottom right, top left, top right.
public Point3d[] GetNearPlaneCorners()
Four corner points on success. Empty array if viewport is not valid.

GetObjectData

Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(
info,
The System.Runtime.Serialization.SerializationInfo to populate with data.
context
The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.
)
inherited fromCommonObject

GetPointDepth

#Since v5.0
Gets the clipping distance of a point. This function ignores the current value of the viewport's near and far settings. If the viewport is a perspective projection, then it intersects the semi infinite frustum volume with the bounding box and returns the near and far distances of the intersection. If the viewport is a parallel projection, it intersects the infinite view region with the bounding box and returns the near and far distances of the projection.
public bool GetPointDepth(
point,
A point to measure.
out double
distance
distance of the point (can be < 0)
)
true if the bounding box intersects the view frustum and near_dist/far_dist were set. false if the bounding box does not intersect the view frustum.

GetScreenPort

#Since v5.0
Gets the location of viewport in pixels. See documentation for SetScreenPort.
public Rectangle GetScreenPort()
The rectangle, or Empty rectangle on error.

GetScreenPort

#Since v5.0
Gets the location of viewport in pixels.

See value meanings in SetScreenPort.

public Rectangle GetScreenPort(
out int
near,
The near value. This out parameter is assigned during the call.
out int
far
The far value. This out parameter is assigned during the call.
)
The rectangle, or Empty rectangle on error.

GetScreenPortLocation

#Since v6.0
Get the location of viewport in pixels (non System.Drawing version of GetScreenPort)
public void GetScreenPortLocation(
out int
left,
out int
top,
out int
right,
out int
bottom
)

GetSphereDepth

#Since v5.0
Gets near and far clipping distances of a bounding sphere.
public bool GetSphereDepth(
sphere,
The sphere to sample.
out double
nearDistance,
Near distance of the sphere (can be < 0)
out double
farDistance
Far distance of the sphere (can be equal to near_dist)
)
true if the sphere intersects the view frustum and near_dist/far_dist were set. false if the sphere does not intersect the view frustum.

GetViewScale

#Since v8.0
Get scaling applied to this viewport projection. Reflected ceiling projections will return the values 1,1,-1
public double[] GetViewScale()

GetWorldToScreenScale

#Since v5.1
Gets the scale factor from point in frustum to screen scale.
public double GetWorldToScreenScale(
pointInFrustum
point in viewing frustum.
)
number of pixels per world unit at the 3d point.

GetXform

#Since v5.0
Computes a transform from a coordinate system to another.
public Transform GetXform(
sourceSystem,
The coordinate system to map from.
destinationSystem
The coordinate system to map into.
)
The 4x4 transformation matrix (acts on the left).

IsValidWithLog

Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
public bool IsValidWithLog(
out string
log
A textual log. This out parameter is assigned during this call.
)
inherited fromCommonObject
true if this object is valid; false otherwise.

NonConstOperation

For derived classes implementers.

Defines the necessary implementation to free the instance from being constant.

protected virtual void NonConstOperation()
inherited fromCommonObject

OnSwitchToNonConst

Is called when a non-constant operation first occurs.
protected virtual void OnSwitchToNonConst()
inherited fromCommonObject

RotateCamera

#Since v7.0
Rotates the view camera.
public bool RotateCamera(
rotationAngleRadians,
The amount to rotate expressed in radians.
rotationAxis,
The axis to rotate around.
rotationCenter
The point to rotate around.
)
True if rotation is successful, false otherwise.

SetCameraDirection

#Since v5.0
Sets the direction that the camera faces.
public bool SetCameraDirection(
direction
A new direction.
)
true if the direction was set; otherwise false.

SetCameraLocation

#Since v5.0
Sets the camera location (position) point.
public bool SetCameraLocation(
location
)
true if the operation succeeded; otherwise, false.

SetCameraUp

#Since v5.0
Sets the camera up vector.
public bool SetCameraUp(
up
A new direction.
)
true if the direction was set; otherwise false.

SetFrustum

#Since v5.0
Sets the view frustum. If FrustumSymmetryIsLocked() is true and left != -right or bottom != -top, then they will be adjusted so the resulting frustum is symmetric.
public bool SetFrustum(
left,
A new left value.
right,
A new right value.
bottom,
A new bottom value.
top,
A new top value.
nearDistance,
A new near distance value.
farDistance
A new far distance value.
)
true if operation succeeded; otherwise, false.

SetFrustumNearFar

#Since v5.0
Sets the frustum near and far using a bounding box.
public bool SetFrustumNearFar(
boundingBox
A bounding box to use.
)
true if operation succeeded; otherwise, false.

SetFrustumNearFar

#Since v5.0
Sets near and far clipping distance subject to constraints.
public bool SetFrustumNearFar(
nearDistance,
(>0) desired near clipping distance.
farDistance,
(>near_dist) desired near clipping distance.
minNearDistance,
If min_near_dist <= 0.0, it is ignored. If min_near_dist > 0 and near_dist < min_near_dist, then the frustum's near_dist will be increased to min_near_dist.
minNearOverFar,
If min_near_over_far <= 0.0, it is ignored. If near_dist < far_dist*min_near_over_far, then near_dist is increased and/or far_dist is decreased so that near_dist = far_dist*min_near_over_far. If near_dist < target_dist < far_dist, then near_dist near_dist is increased and far_dist is decreased so that projection precision will be good at target_dist. Otherwise, near_dist is simply set to far_dist*min_near_over_far.
targetDistance
If target_dist <= 0.0, it is ignored. If target_dist > 0, it is used as described in the description of the min_near_over_far parameter.
)
true if operation succeeded; otherwise, false.

SetFrustumNearFar

#Since v5.0
Sets the frustum near and far distances using two values.
public bool SetFrustumNearFar(
nearDistance,
The new near distance.
farDistance
The new far distance.
)
true if operation succeeded; otherwise, false.

SetFrustumNearFar

#Since v5.0
Sets the frustum near and far using a center point and radius.
public bool SetFrustumNearFar(
center,
A center point.
radius
A radius value.
)
true if operation succeeded; otherwise, false.

SetScreenPort

#Since v5.0
Location of viewport in pixels. These are provided so you can set the port you are using and get the appropriate transformations to and from screen space. // For a Windows window / int width = width of window client area in pixels; / int height = height of window client area in pixels; / port_left = 0; / port_right = width; / port_top = 0; / port_bottom = height; / port_near = 0; / port_far = 1; / SetScreenPort( port_left, port_right, / port_bottom, port_top, / port_near, port_far );
public bool SetScreenPort(
left,
A left value.
right,
A left value. (port_left != port_right)
bottom,
A bottom value.
top,
A top value. (port_top != port_bottom)
near,
A near value.
far
A far value.
)
true if input is valid.

SetScreenPort

#Since v5.0
Gets the location of viewport in pixels.

See value meanings in SetScreenPort.

public bool SetScreenPort(
windowRectangle,
A new rectangle.
near,
The near value.
far
The far value.
)
true if input is valid.

SetScreenPort

#Since v5.0
Gets the location of viewport in pixels.

See value meanings in SetScreenPort.

public bool SetScreenPort(
windowRectangle
A new rectangle.
)
true if input is valid.

SetViewScale

#Since v8.0
Set scaling applied for this viewport projection. For reflected projections, call with values 1,1,-1
public void SetViewScale(
scaleX,
scaleY,
scaleZ
)

TargetDistance

#Since v5.0
Gets the distance from the target point to the camera plane. Note that if the frustum is not symmetric, then this distance is shorter than the distance from the target to the camera location.
public double TargetDistance(
useFrustumCenterFallback
If bUseFrustumCenterFallback is false and the target point is not valid, then ON_UNSET_VALUE is returned. If bUseFrustumCenterFallback is true and the frustum is valid and current target point is not valid or is behind the camera, then 0.5*(near + far) is returned.
)
Shortest signed distance from camera plane to target point. If the target point is on the visible side of the camera, a positive value is returned. ON_UNSET_VALUE is returned when the input of view is not valid.

ToJSON

Create a JSON string representation of this object
public string ToJSON()
inherited fromCommonObject

TransformCamera

#Since v7.0
Transforms the view camera location, direction, and up.
public bool TransformCamera(
xform
Transformation to apply to camera.
)
True if a valid camera was transformed, false if invalid camera, frustum, or transformation.

UnlockCamera

#Since v5.0
Unlocks the camera vectors and location.
public void UnlockCamera()

UnlockFrustumSymmetry

#Since v5.0
Unlocks frustum horizontal and vertical symmetries.
public void UnlockFrustumSymmetry()

ZoomToScreenRect

#Since v5.0
Zooms to a screen zone.

View changing from screen input points. Handy for using a mouse to manipulate a view. ZoomToScreenRect() may change camera and frustum settings.

public bool ZoomToScreenRect(
left,
Screen coordinate.
top,
Screen coordinate.
right,
Screen coordinate.
bottom
Screen coordinate.
)
true if the operation succeeded; otherwise, false.

ZoomToScreenRect

#Since v5.0
Zooms to a screen zone.

View changing from screen input points. Handy for using a mouse to manipulate a view. ZoomToScreenRect() may change camera and frustum settings.

public bool ZoomToScreenRect(
windowRectangle
The new window rectangle in screen space.
)
true if the operation succeeded; otherwise, false.