perspective
perspective angle
PERSPECTIVE(nged)
NAME
perspective - get or set the view perspective angle
On this page
SYNOPSIS
DESCRIPTION
The perspective command gets or sets the perspective (field-of-view) angle for the current view.
-
No arguments: Returns the current value of
gv_perspectiveas a floating-point number. A value of 0 (or any value ≤SMALL_FASTF) indicates orthographic (parallel) projection. -
One argument
angle: Setsgv_perspectiveto the given value (in degrees). The behavior depends on the magnitude of the angle:-
If
angle > SMALL_FASTF(i.e. a positive, non-trivial value): A perspective projection matrix is constructed viapersp_matwith aspect ratio 1.0, near clip at 0.01, and far clip at 1×1010. This matrix is stored ingv_pmatand the view is updated viabv_update. -
If
angle ≤ SMALL_FASTF(zero or negative): The perspective matrixgv_pmatis reset to the identity matrix, effectively switching to orthographic projection.
-
Typical useful perspective angles range from about 15° (narrow, telephoto-like) to 90° (wide, distorted). Values above 90° produce strongly distorted views. Setting the angle to 0 disables perspective entirely.
EXAMPLES
mged> perspective
Returns the current perspective angle, e.g. 0 when orthographic projection is active.
mged> perspective 45
Sets the field of view to 45°. Objects farther from the viewer will appear smaller relative to nearby objects.
mged> perspective 15
Sets a narrow 15° field of view, compressing depth and making distant objects appear proportionally larger.
mged> perspective 0
Resets gv_pmat to the identity matrix, switching the view back to orthographic (parallel) projection.
AUTHOR
BRL-CAD Team
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org