model2view
model2view x y z
MODEL2VIEW(nged)
NAME
model2view - convert model coordinates to view (screen) coordinates
On this page
SYNOPSIS
DESCRIPTION
The model2view command has two distinct behaviors depending on whether arguments are provided:
-
No arguments: Returns the current model-to-view transformation matrix (
gv_model2view) as a 16-element space-separated floating-point string (encoded bybn_encode_mat). This is the raw 4×4 matrix used by BRL-CAD’s view system to transform geometry from model space into normalized view space. -
Three arguments
x y z: Treats the arguments as a model-space point in millimeters (not local units) and transforms it through thegv_model2viewmatrix usingMAT4X3PNT, returning the resulting 3-element normalized view-space vector. Note that the input is expected in base (mm) units, not local units.
The matrix form is the mathematical inverse of the view2model matrix.
For point conversion with local-unit scaling applied (the more common case for interactive use), prefer model2view_lu or m2v_point.
EXAMPLES
mged> model2view
Returns the 16-element gv_model2view matrix as a space-separated string reflecting the current view rotation and zoom.
mged> model2view 0 0 0
0 0 0
Transforms the model origin (in mm) into normalized view space. Returns the view-space position of the model origin.
mged> set m2v [model2view] mged> mat4x3pnt $m2v "25.4 0 0"
Retrieves the model-to-view matrix and manually applies it to the model point (25.4 mm = 1 inch along X), yielding the normalized view-space position of that point.
AUTHOR
BRL-CAD Team
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org