Skip to documentation
DocumentationAll documentsEnglish

VIEW2MODEL_LU(nged)

NAME

view2model_lu - convert view xyz to model coordinates (local units)

On this page

SYNOPSIS

view2model_lu x y z

DESCRIPTION

The view2model_lu command converts 3D view-space coordinates (in local units) into 3D model-space coordinates (also in local units). The three arguments x y z are view-space coordinates in local units.

The conversion pipeline: the input is first scaled down by 1 / (gv_scale × base2local) to get normalized view-space coordinates, then transformed by the gv_view2model matrix to get model-space base coordinates, and finally scaled by base2local to produce the result in local units.

This is the local-unit counterpart to v2m_point, which works in normalized (non-unit-scaled) view space.

The inverse operation is model2view_lu.

EXAMPLES

Example 1. Convert a view-space point back to model coordinates

mged> view2model_lu 0 0 0

Returns the model-space position (in local units) of the view origin. When the view is looking at the model origin, this returns the center of the current view.

Example 2. Round-trip conversion

mged> set vp [model2view_lu 100 50 0] mged> view2model_lu {*}$vp

Converts the model point (100, 50, 0) to view space and back; the result should match the original model coordinates.

AUTHOR

BRL-CAD Team

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org