PMAT(nged)

get or set the perspective projection matrix

๐Ÿ“… published 7.44.0, from nixpkgs unstable

๐Ÿ’… PMAT(nged) โ€” bestie's guide to the perspective projection matrix ๐ŸŽ€

okay so real talk, this is a BRL-CAD User Commands page, it lives in the nged manual section, and it's literally just about peeking at (or yeeting a whole new value into) the perspective projection matrix for your current view. iconic behavior honestly โœจ


๐ŸŒธ NAME ๐ŸŒธ

pmat โ€” get or set the perspective projection matrix. that's it. that's the whole vibe ๐Ÿซถ


โœจ SYNOPSIS โœจ

pmat
pmat "m0 m1 m2 ... m15"

two modes, bestie: look ๐Ÿ‘€ or set ๐Ÿ’…


๐Ÿ’– DESCRIPTION ๐Ÿ’–

so the pmat command gets or sets the perspective projection matrix for the current view. it's giving "small command, big responsibility" ngl.

  • No arguments โ€” it returns the current projection matrix as a 16-element space-separated floating-point string representing the 4ร—4 matrix in row-major order. this matrix is the main character that controls perspective rendering ๐Ÿ”ฅ
  • One argument โ€” it sets the projection matrix from a provided 16-element space-separated string. the string must contain exactly 16 floating-point values โ€” not 15, not 17, exactly 16, no cap. the view is updated immediately after the change, like instant glow-up โœจ

the perspective matrix is normally managed automatically by the perspective command, which sets it from a field-of-view angle. so think of perspective as the auto-pilot ๐Ÿ›ซ and pmat as the manual override ๐ŸŽฎ โ€” use pmat to inspect the current matrix or to provide a custom projection matrix directly. iykyk ๐Ÿ’…

and here's the little fun fact you need: when perspective is disabled (perspective 0), the projection matrix is the identity and pmat returns:

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

slay. that's the identity matrix, the "no thoughts, head empty" of matrices ๐ŸŽ€


๐Ÿฆ‹ EXAMPLES ๐Ÿฆ‹

๐ŸŒˆ Example 1. Retrieve the current perspective matrix

mged> pmat

returns the current perspective projection matrix as 16 numbers. when perspective is active (e.g. after perspective 45), this will be a non-identity matrix; when orthographic, it will be the identity. literally the vibe check of matrices ๐Ÿ‘‘

๐Ÿ“ Example 2. Inspect the matrix after setting perspective

mged> perspective 60 mged> pmat

sets the perspective angle to 60ยฐ and then retrieves the resulting projection matrix to examine the constructed values. set it, then peek at it โ€” the way that combo just works ๐Ÿ’–

๐Ÿงš Example 3. Set the perspective matrix explicitly

mged> pmat "1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1"

sets the projection matrix to the identity, equivalent to perspective 0. the quoted string must contain exactly 16 space-separated values โ€” count them, bestie, fr fr ๐Ÿ”ข

โš ๏ธ don't be out here submitting 15 values or 17 values and expecting it to hit. exactly 16. the manpage said what it said ๐Ÿ’€

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

BRL-CAD Team โ€” the ones who built all this ๐Ÿซถ


๐Ÿ“ฌ BUG REPORTS ๐Ÿ“ฌ

reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. if something's acting up, tell the devs, not the group chat ๐Ÿ™ˆ


that's the whole page, bestie โ€” go forth and inspect your matrices responsibly ๐Ÿฆ‹โœจ

BRL-CAD made this one, and the page signs off as PMAT(nged) โ€” periodt ๐Ÿ’…๐ŸŽ€

๐Ÿ“ฆ where this page comes from