M2V_POINT(nged)

convert xyz in model space to xyz in view space

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’… m2v_point β€” like, the nged command that turns model-space xyz into view-space xyz ✨

okay bestie, welcome to the nged manual, and buckle up because this little icon is about to make your 3D coordinates make sense. πŸŽ€


✨ NAME ✨

m2v_point β€” converts xyz in model space to xyz in view space. literally its whole personality. no cap. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

m2v_point x y z
m2v_point "x y z"

two ways in, one vibe out. pick your fighter. πŸ’…


🌸 DESCRIPTION 🌸

so the m2v_point command takes a point in model space and converts it to its equivalent position in view space, using the current view's model-to-view transformation matrix β€” that's gv_model2view, iykyk. the result comes back as a space-separated string of three floating-point view coordinates. three numbers, all vibing in a row. ✨

you can hand it that point in two forms, and honestly both slay:

  • three separate arguments: m2v_point x y z β€” the X, Y, and Z model coordinates are given as three individual numbers. one for each axis, super clean. 🫢
  • a single quoted vector: m2v_point "x y z" β€” all three coordinates are provided as one space-separated string, which is decoded using bn_decode_vect. quoted string, decoded, done. πŸŽ€
heads up bestie: the command requires an active view to be present. no view, no conversion, periodt. πŸ’€

the returned view coordinates are in BRL-CAD's normalized view space, where (0, 0, 0) is the view center and the extents are determined by the current view size. so like, center of the view is zero-zero-zero and everything else is measured relative to that. iconic. πŸ‘‘

and if you ever need to go the other way β€” view to model β€” the inverse operation is provided by the v2m_point command. they're giving matching bestie energy fr fr. 🌈


πŸ”₯ EXAMPLES πŸ”₯

Example 1. Convert the model origin to view coordinates

mged> m2v_point 0 0 0

0 0 0

when the view is looking straight at the model origin with no rotation, the origin maps to view center (0, 0, 0). literally the main character of points. ⭐

Example 2. Convert an offset model point

mged> m2v_point 100 0 0

returns the view-space position of the model point 100 units along the X axis, accounting for any current view rotation and zoom. rotation and zoom stay in the chat, and they will be factored in. πŸ¦‹

Example 3. Using a quoted vector string

mged> m2v_point "50 25 10"

equivalent to m2v_point 50 25 10. converts model point (50, 25, 10) to view coordinates. same result, different entrance. πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” the icons who built this. 🫢


πŸ’Œ BUG REPORTS πŸ’Œ

reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. found something cursed? tell the devs, not the group chat. 😭


okay that's the whole page, bestie β€” and since we can't just paste the boring footer, here's the sign-off: this absolute gem lives in the BRL-CAD house of docs, filed under M2V_POINT(nged), and it's yours to use. go convert some points, you're gonna eat. πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from