RMAT(nged)

get or set the view rotation matrix

πŸ“… published 7.44.0, from nixpkgs unstable

✨ RMAT (nged) ✨ β€” get or set the view rotation matrix

okay bestie, welcome to the nged corner of the BRL-CAD User Commands universe πŸ¦‹ this one's short but it's a whole vibe.

πŸ’… NAME

rmat β€” get or set the view rotation matrix. that's it. that's the whole thing. iconic behavior, honestly.

πŸŽ€ SYNOPSIS

rmat
rmat "m0 m1 m2 ... m15"

🌸 DESCRIPTION

so the rmat command gets or sets the current view rotation matrix, and it does it as a 16-element space-separated floating-point string. yes, sixteen. count 'em. 🧚

  • no arguments β€” it hands you back the current view rotation as a 16-element string, which is the 4Γ—4 rotation matrix in row-major order. peek at the raw matrix, no notes.
  • one argument β€” it sets the view rotation from the 16-element space-separated string you gave it. the string has to decode to exactly 16 values, no more no less, and the view is updated immediately after the change. instant. no reload. slay. πŸ’«

now, what does a rotation matrix even do? it controls how model space is oriented in the view β€” like which direction is "up", "forward", etc. it's literally the same rotation that quat and ae use, except expressed directly as a matrix instead of as a quaternion or as azimuth/elevation angles. so use this command when you wanna inspect the raw matrix, or when you need to set a custom rotation that was computed externally β€” a real one for the outside-computation girlies 🫢

the set form takes the matrix as a single quoted string. and like, actually β€” if you provide more than one argument you get a usage error. not a vibe. don't do it. πŸ™ˆ

πŸ”₯ EXAMPLES

πŸ’– Example 1. Retrieve the current rotation matrix

mged> rmat

returns the current 16-element view rotation matrix, e.g. 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 for the identity (no rotation). that's the "i'm not even trying" matrix and honestly? respect.

πŸ¦‹ Example 2. Round-trip: capture and restore rotation

mged> set m [rmat] mged> ae 35 25 mged> rmat $m

this one saves the current rotation matrix, changes to a 35/25 azimuth-elevation view, then restores the original matrix directly. capture, mess around, put it back. main character energy. ✨

🌈 Example 3. Set the identity rotation (front view)

mged> rmat "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"

sets the view rotation to the identity matrix β€” the default front-facing orientation with no rotation applied. factory settings, but make it fashion. πŸ‘‘

πŸ‘‘ AUTHOR

BRL-CAD Team β€” legends, every one of them πŸ’œ

πŸ’€ BUG REPORTS

found a bug? a little problem? a situation? reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. they want to hear about it fr fr πŸ“¬


that's the whole page bestie, go rotate something πŸŽ€ and yeah β€” this was brought to you by BRL-CAD (and the RMAT(nged) page), mwah πŸ’‹

πŸ“¦ where this page comes from