Overview
/
KCL Standard Library
/
Functions
/
view::oriented

view::orientedFunction in std::view

WARNING: This function is experimental and may change or be removed.

Create a camera view that looks at the model from a standard orientation.

The returned value stores intent, not resolved numbers: an argument you omit stays absent, and the consumer that activates the view resolves it against the model it is showing, so one view value is valid for any model.

Every argument you do pass must be a finite number; an infinite or undefined value, such as one produced by dividing by zero, is an error rather than a stored value no consumer could use.

Lengths are recorded in millimeters whatever unit you write them in, so distance = 2inch is stored as 50.8mm. The view means the same thing either way; a tool that reads the view back reports millimeters.

A distance is a separation, so it must be greater than zero. Zero would put the camera on the point it looks at, and a negative value would put it behind that point; both are errors rather than a camera nobody can resolve. A target is a point, so its coordinates may be negative.

Arguments

NameTypeDescriptionRequired
orientationOrientationThe standard orientation the camera looks from.Yes
targetPoint3dThe point the camera looks at. When omitted, the view centers on the bounds of the model at activation.No
distancenumber(Length)The distance from the camera to the target. Must be greater than zero. When omitted, the view fits the model at activation.No
projectionProjectionThe camera projection. When omitted, the view is orthographic, so the same file renders identically in every consumer.No

Returns

CameraView - A camera viewpoint, stored as intent: what the camera looks at and from which direction, not a snapshot of engine camera state.

Examples