QUAT(nged)

get or set the view orientation as a quaternion

πŸ“… published 7.44.0, from nixpkgs unstable

πŸ’– NAME πŸ’–

Bestie, meet quat(nged) from BRL-CAD User Commands β€” the command to get or set the view orientation as a quaternion. Slay. πŸ’…

✨ SYNOPSIS ✨

quat
quat a b c d

πŸŽ€ DESCRIPTION πŸŽ€

Okay so quat gets or sets the current view rotation as a unit quaternion with components ordered (a, b, c, d) β€” that is, (x, y, z, w), where (x, y, z) is the vector part and w is the scalar part. No cap, that ordering matters. πŸ¦‹

  • No arguments β€” returns the current view rotation matrix as a quaternion, formatted as four space-separated floating-point values with 12 significant digits: a b c d. Literally just the numbers, bestie. ✨
  • Four arguments a b c d β€” sets the view rotation from the given quaternion. Each component is provided as a separate argument. The quaternion is converted to a rotation matrix and the view is updated immediately. Instant glow-up for your view. πŸ”₯

quat is closely related to orient / orientation, which accepts the same quaternion but as either four separate values or a single quoted string. quat always uses four separate arguments. iykyk πŸ’œ

To set the view by azimuth/elevation angles instead of a quaternion, use ae. Different vibe, same goal. πŸ¦‹

🌈 EXAMPLES 🌈

πŸ“ Example 1. Get the current view quaternion

mged> quat

Returns the current view rotation as a quaternion, e.g. 0.5 -0.5 -0.5 0.5 for a typical isometric view. The four values are the x y z w components. Cutie little quaternion snapshot. πŸ“Έ

πŸ¦‹ Example 2. Set the view to look down the -Z axis (top view)

mged> quat 0.707107 0 0 0.707107

Sets the view orientation to a 90Β° rotation about the X axis β€” a top-down view. The quaternion (sin(45Β°), 0, 0, cos(45Β°)) encodes this rotation. Math but make it cute. ✨

πŸŽ€ Example 3. Set the view to the identity (front view, no rotation)

mged> quat 0 0 0 1

Sets the view to the identity quaternion β€” the default front-facing orientation with no rotation applied. Clean slate, main character energy. πŸ‘‘

πŸ’œ Example 4. Round-trip: capture and restore orientation

mged> set q [quat] mged> ae 35 25 mged> quat {*}$q

Saves the current quaternion, changes to a 35/25 azimuth-elevation view, then restores the original orientation using Tcl list expansion. Save, switch, restore β€” the full routine. 🫢

πŸ‘‘ AUTHOR πŸ‘‘

BRL-CAD Team β€” iconic. 🫢

πŸ› BUG REPORTS πŸ›

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. Don't suffer in silence, bestie. πŸ’Œ


Signing off with the BRL-CAD source/version line and QUAT(nged); the footer doesn't list a separate date for me to report. πŸ’œβœ¨

πŸ“¦ where this page comes from