PMAT(nged)
get or set the perspective projection matrix
๐ 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
- 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