VIEW2MODEL_LU(nged)

convert view xyz to model coordinates (local units)

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’… 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:

  1. the input is first scaled down by 1 / (gv_scale Γ— base2local) to get normalized view-space coordinates 🌈
  2. then it's transformed by the gv_view2model matrix to get model-space base coordinates πŸ¦‹
  3. and finally it's scaled by base2local to 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