VIEW2MODEL_LU(nged)
convert view xyz to model coordinates (local units)
π view2model_lu (nged) β the BRL-CAD glow-up edition
okay so bestie, welcome to view2model_lu from the BRL-CAD user commands family β she's a tiny little nged command and honestly she's giving "small but mighty" β¨
πΈ NAME πΈ
view2model_lu β convert view xyz to model coordinates (local units) π«Ά
β SYNOPSIS β
view2model_lu x y z
π DESCRIPTION π
okay so here's the tea: view2model_lu converts 3D view-space coordinates (in local units) into 3D model-space coordinates (also in local units). iconic behavior honestly. the three arguments x y z are your view-space coordinates, and yes, they're in local units too π
now for the conversion pipeline, bestie, it's a whole three-step routine and it ate:
- the input is first scaled down by
1 / (gv_scale Γ base2local)to get normalized view-space coordinates π - then it's transformed by the
gv_view2modelmatrix to get model-space base coordinates π¦ - and finally it's scaled by
base2localto produce the result in local units β¨
so like, this is the local-unit counterpart to v2m_point, which works in normalized (non-unit-scaled) view space. different vibe, same energy, iykyk π
and if you ever need to go the other way? the inverse operation is model2view_lu, no cap π
π 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. and when the view is looking at the model origin? this returns the center of the current view. literally so satisfying π
Example 2. Round-trip conversion π₯
mged> set vp [model2view_lu 100 50 0] mged> view2model_lu {*}$vp
this converts the model point (100, 50, 0) to view space and back, and the result should match the original model coordinates. round trip bestie!! we love a full circle moment π«Ά
π AUTHOR π
BRL-CAD Team π
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org π§ (please do, they wanna know, fr fr)
so yeah, that's the whole page, no notes, she's perfect π
πΈ this has been view2model_lu(nged) from the BRL-CAD pages β catch you on the flip side, bestie, mwah πβ¨π¦
π¦ 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