QUAT(nged)
get or set the view orientation as a quaternion
π 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
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms