MODEL2VIEW(nged)
convert model coordinates to view (screen) coordinates
π MODEL2VIEW (nged) β bestie's guide to model β view coords β¨
okay so this is a nged command, and it's genuinely iconic once you get the vibe β it converts model coordinates to view (screen) coordinates. two whole personalities depending on how you call it, iykyk π
πΈ SYNOPSIS
model2view
model2view x y z
π¦ DESCRIPTION
model2view has two distinct behaviors depending on whether you pass arguments or not. not me loving a command with range π
- No arguments: it hands you back 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 that BRL-CAD's view system uses to transform geometry from model space into normalized view space. like, the whole plot. π - Three arguments
x y z: treats those args as a model-space point in millimeters (not local units!) and transforms it through thegv_model2viewmatrix usingMAT4X3PNT, giving you the resulting 3-element normalized view-space vector. so yeah β the input is expected in base (mm) units, not local units. π don't say I didn't warn you.
the matrix form is the mathematical inverse of the view2model matrix. cute, symmetric, obsessed.
if you actually want point conversion with local-unit scaling applied (which is the more common case for interactive use), go usemodel2view_luorm2v_pointinstead β they're the main characters for that job π«Ά
β¨ EXAMPLES
π Example 1. Retrieve the current model-to-view matrix
mged> model2view
Returns the 16-element gv_model2view matrix as a space-separated string, reflecting the current view rotation and zoom. lowkey a little snapshot of your viewport's whole soul π
π Example 2. Transform a model point to view space (in mm)
mged> model2view 0 0 0
0 0 0
Transforms the model origin (in mm) into normalized view space, and returns the view-space position of the model origin. yes that's 0 0 0 in and 0 0 0 out here, no cap π
π Example 3. Capture matrix for use with mat4x3pnt
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. grab the matrix, do the math yourself, main character energy fr fr π₯
π AUTHOR
BRL-CAD Team β legends, every one of them πΈ
π BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β they genuinely want to hear it, so spill π
okay that's the whole page, mwah π this one comes to you straight from the BRL-CAD manual (the MODEL2VIEW (nged) page, obvs) β the software's version and date live in that footer, so go check the source if you need the exact stamp β¨ slay, go convert some coordinates π¦
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms