VIEW2MODEL_VEC(nged)

transform a direction vector from view space to model space

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’… VIEW2MODEL_VEC (nged) β€” the BRL-CAD user command that yeets your direction vector from view space into model space ✨

okay so bestie, welcome to the nged corner of the BRL-CAD User Commands lineup πŸŽ€ this one's a lil function and she is so useful once you get what she's doing, promise 🫢


✨ NAME ✨

view2model_vec β€” transforms a direction vector from view space to model space πŸ’«


🌸 SYNOPSIS 🌸

view2model_vec x y z

that's it, that's the whole vibe πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” view2model_vec takes a direction vector, applies the inverse of the current view rotation to it, and hands you back the result as a space-separated x y z triplet in model space. no cap, that's the whole job ✨

and now the important part, bestie, listen up πŸ‘‘ β€” this command transforms a direction vector, not a point. direction vectors are little vibe-check-only creatures: they represent orientation or displacement, they have no fixed position in space, so translation literally does not apply to them πŸ™ˆ only the rotational component of the view transform gets inverted and applied. this is exactly what makes view2model_vec different from v2m_point, which transforms a position using the full view-to-model mapping including translation and scale. different tools, different jobs, both icons πŸ’–

you need exactly three separate floating-point arguments. and unlike v2m_point, a single quoted triplet form is not accepted β€” the argument count must be exactly 4 (the command plus three values). no shortcuts, no bundling, no "but bestie I tried it in one string" 😭 the count is the count πŸŽ€

use this one when you're converting a direction expressed in screen/view orientation β€” like a movement delta, a surface normal, or an axis direction β€” back into model-space orientation. that's literally her moment to shine 🌈

⭐ EXAMPLES ⭐

πŸ’– Example 1. Convert the view's forward direction to model space πŸ’–

mged> view2model_vec 0 0 -1

this transforms the view-space vector pointing into the screen (0, 0, -1) into model-space coordinates πŸ”₯ the result is the model-space direction corresponding to "into the screen" in the current view. lowkey iconic.

πŸ“ Example 2. Convert a view-space displacement direction πŸ“

mged> view2model_vec 1 0 0

this returns the model-space direction corresponding to "right" in the current view πŸ’« super useful for computing model-space movements aligned with the screen axes. main character energy fr fr 🧚


πŸŽ€ AUTHOR πŸŽ€

the BRL-CAD Team 🫢 absolute legends, we stan.


πŸ’€ BUG REPORTS πŸ’€

if something's being sus and you find a bug or a problem, reports should be submitted via electronic mail to devs@brlcad.org πŸ“§ please do tell them, bestie, they wanna know 🌸


aaaand that's the page, gorgeous πŸ’– this one ships out of BRL-CAD, the VIEW2MODEL_VEC(nged) manual β€” go forth and transform those direction vectors, mwah πŸ˜˜πŸ’…πŸ¦‹

πŸ“¦ where this page comes from