| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Matrix4 - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <h1 translate="no">Matrix4</h1>
- <section>
- <header>
- <div class="class-description"><p>Represents a 4x4 matrix.</p>
- <p>The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix.
- For an introduction to transformation matrices as used in WebGL, check out <a href="https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices" target="_blank" rel="noopener">this tutorial</a></p>
- <p>This allows a 3D vector representing a point in 3D space to undergo
- transformations such as translation, rotation, shear, scale, reflection,
- orthogonal or perspective projection and so on, by being multiplied by the
- matrix. This is known as <code>applying</code> the matrix to the vector.</p>
- <p>A Note on Row-Major and Column-Major Ordering:</p>
- <p>The constructor and <a href="Matrix3.html#set">Matrix3#set</a> method take arguments in
- <a href="https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order" target="_blank" rel="noopener">row-major</a>
- order, while internally they are stored in the <a href="Matrix3.html#elements">Matrix3#elements</a> array in column-major order.
- This means that calling:</p>
- <pre><code class="language-js">const m = new THREE.Matrix4();
- m.set( 11, 12, 13, 14,
- 21, 22, 23, 24,
- 31, 32, 33, 34,
- 41, 42, 43, 44 );
- </code></pre>
- <p>will result in the elements array containing:</p>
- <pre><code class="language-js">m.elements = [ 11, 21, 31, 41,
- 12, 22, 32, 42,
- 13, 23, 33, 43,
- 14, 24, 34, 44 ];
- </code></pre>
- <p>and internally all calculations are performed using column-major ordering.
- However, as the actual ordering makes no difference mathematically and
- most people are used to thinking about matrices in row-major order, the
- three.js documentation shows matrices in row-major order. Just bear in
- mind that if you are reading the source code, you'll have to take the
- transpose of any matrices outlined here to make sense of the calculations.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="Matrix4" translate="no">new <a href="#Matrix4">Matrix4</a><span class="signature">( n11 : <span class="param-type">number</span>, n12 : <span class="param-type">number</span>, n13 : <span class="param-type">number</span>, n14 : <span class="param-type">number</span>, n21 : <span class="param-type">number</span>, n22 : <span class="param-type">number</span>, n23 : <span class="param-type">number</span>, n24 : <span class="param-type">number</span>, n31 : <span class="param-type">number</span>, n32 : <span class="param-type">number</span>, n33 : <span class="param-type">number</span>, n34 : <span class="param-type">number</span>, n41 : <span class="param-type">number</span>, n42 : <span class="param-type">number</span>, n43 : <span class="param-type">number</span>, n44 : <span class="param-type">number</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new 4x4 matrix. The arguments are supposed to be
- in row-major order. If no arguments are provided, the constructor
- initializes the matrix as an identity matrix.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">n11</strong>
- </td>
- <td class="description last">
- <p>1-1 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n12</strong>
- </td>
- <td class="description last">
- <p>1-2 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n13</strong>
- </td>
- <td class="description last">
- <p>1-3 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n14</strong>
- </td>
- <td class="description last">
- <p>1-4 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n21</strong>
- </td>
- <td class="description last">
- <p>2-1 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n22</strong>
- </td>
- <td class="description last">
- <p>2-2 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n23</strong>
- </td>
- <td class="description last">
- <p>2-3 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n24</strong>
- </td>
- <td class="description last">
- <p>2-4 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n31</strong>
- </td>
- <td class="description last">
- <p>3-1 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n32</strong>
- </td>
- <td class="description last">
- <p>3-2 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n33</strong>
- </td>
- <td class="description last">
- <p>3-3 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n34</strong>
- </td>
- <td class="description last">
- <p>3-4 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n41</strong>
- </td>
- <td class="description last">
- <p>4-1 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n42</strong>
- </td>
- <td class="description last">
- <p>4-2 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n43</strong>
- </td>
- <td class="description last">
- <p>4-3 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n44</strong>
- </td>
- <td class="description last">
- <p>4-4 matrix element.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="elements" translate="no">.<a href="#elements">elements</a><span class="type-signature"> : Array.<number></span> </h3>
- <div class="description">
- <p>A column-major list of matrix values.</p>
- </div>
- </div>
- <h2 class="subsection-title">Methods</h2>
- <h3 class="name name-method" id="clone" translate="no">.<a href="#clone">clone</a><span class="signature">()</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns a matrix with copied values from this instance.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A clone of this instance.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="compose" translate="no">.<a href="#compose">compose</a><span class="signature">( position : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, quaternion : <span class="param-type"><a href="Quaternion.html">Quaternion</a></span>, scale : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix to the transformation composed of the given position,
- rotation (Quaternion) and scale.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">position</strong>
- </td>
- <td class="description last">
- <p>The position vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">quaternion</strong>
- </td>
- <td class="description last">
- <p>The rotation as a Quaternion.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">scale</strong>
- </td>
- <td class="description last">
- <p>The scale vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="copy" translate="no">.<a href="#copy">copy</a><span class="signature">( m : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Copies the values of the given matrix to this instance.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">m</strong>
- </td>
- <td class="description last">
- <p>The matrix to copy.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="copyPosition" translate="no">.<a href="#copyPosition">copyPosition</a><span class="signature">( m : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Copies the translation component of the given matrix
- into this matrix's translation component.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">m</strong>
- </td>
- <td class="description last">
- <p>The matrix to copy the translation component.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="decompose" translate="no">.<a href="#decompose">decompose</a><span class="signature">( position : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, quaternion : <span class="param-type"><a href="Quaternion.html">Quaternion</a></span>, scale : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Decomposes this matrix into its position, rotation and scale components
- and provides the result in the given objects.</p>
- <p>Note: Not all matrices are decomposable in this way. For example, if an
- object has a non-uniformly scaled parent, then the object's world matrix
- may not be decomposable, and this method may not be appropriate.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">position</strong>
- </td>
- <td class="description last">
- <p>The position vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">quaternion</strong>
- </td>
- <td class="description last">
- <p>The rotation as a Quaternion.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">scale</strong>
- </td>
- <td class="description last">
- <p>The scale vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="determinant" translate="no">.<a href="#determinant">determinant</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
- <div class="method">
- <div class="description">
- <p>Computes and returns the determinant of this matrix.</p>
- <p>Based on the method outlined <a href="http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html" target="_blank" rel="noopener">here</a>.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The determinant.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="equals" translate="no">.<a href="#equals">equals</a><span class="signature">( matrix : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span><span class="type-signature"> : boolean</span> </h3>
- <div class="method">
- <div class="description">
- <p>Returns <code>true</code> if this matrix is equal with the given one.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">matrix</strong>
- </td>
- <td class="description last">
- <p>The matrix to test for equality.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> Whether this matrix is equal with the given one.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="extractBasis" translate="no">.<a href="#extractBasis">extractBasis</a><span class="signature">( xAxis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, yAxis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, zAxis : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Extracts the basis of this matrix into the three axis vectors provided.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">xAxis</strong>
- </td>
- <td class="description last">
- <p>The basis's x axis.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">yAxis</strong>
- </td>
- <td class="description last">
- <p>The basis's y axis.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">zAxis</strong>
- </td>
- <td class="description last">
- <p>The basis's z axis.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="extractRotation" translate="no">.<a href="#extractRotation">extractRotation</a><span class="signature">( m : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Extracts the rotation component of the given matrix
- into this matrix's rotation component.</p>
- <p>Note: This method does not support reflection matrices.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">m</strong>
- </td>
- <td class="description last">
- <p>The matrix.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="fromArray" translate="no">.<a href="#fromArray">fromArray</a><span class="signature">( array : <span class="param-type">Array.<number></span>, offset : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the elements of the matrix from the given array.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">array</strong>
- </td>
- <td class="description last">
- <p>The matrix elements in column-major order.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">offset</strong>
- </td>
- <td class="description last">
- <p>Index of the first element in the array.</p>
- <p>Default is <code>0</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="getMaxScaleOnAxis" translate="no">.<a href="#getMaxScaleOnAxis">getMaxScaleOnAxis</a><span class="signature">()</span><span class="type-signature"> : number</span> </h3>
- <div class="method">
- <div class="description">
- <p>Gets the maximum scale value of the three axes.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The maximum scale.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="identity" translate="no">.<a href="#identity">identity</a><span class="signature">()</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix to the 4x4 identity matrix.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="invert" translate="no">.<a href="#invert">invert</a><span class="signature">()</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Inverts this matrix, using the <a href="https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution" target="_blank" rel="noopener">analytic method</a>.
- You can not invert with a determinant of zero. If you attempt this, the method produces
- a zero matrix instead.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="lookAt" translate="no">.<a href="#lookAt">lookAt</a><span class="signature">( eye : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, target : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, up : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the rotation component of the transformation matrix, looking from <code>eye</code> towards
- <code>target</code>, and oriented by the up-direction.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">eye</strong>
- </td>
- <td class="description last">
- <p>The eye vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">target</strong>
- </td>
- <td class="description last">
- <p>The target vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">up</strong>
- </td>
- <td class="description last">
- <p>The up vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeBasis" translate="no">.<a href="#makeBasis">makeBasis</a><span class="signature">( xAxis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, yAxis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, zAxis : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the given basis vectors to this matrix.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">xAxis</strong>
- </td>
- <td class="description last">
- <p>The basis's x axis.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">yAxis</strong>
- </td>
- <td class="description last">
- <p>The basis's y axis.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">zAxis</strong>
- </td>
- <td class="description last">
- <p>The basis's z axis.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeOrthographic" translate="no">.<a href="#makeOrthographic">makeOrthographic</a><span class="signature">( left : <span class="param-type">number</span>, right : <span class="param-type">number</span>, top : <span class="param-type">number</span>, bottom : <span class="param-type">number</span>, near : <span class="param-type">number</span>, far : <span class="param-type">number</span>, coordinateSystem : <span class="param-type"><a href="global.html#WebGLCoordinateSystem">WebGLCoordinateSystem</a> | <a href="global.html#WebGPUCoordinateSystem">WebGPUCoordinateSystem</a></span>, reversedDepth : <span class="param-type">boolean</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Creates a orthographic projection matrix. This is used internally by
- <a href="OrthographicCamera.html#updateProjectionMatrix">OrthographicCamera#updateProjectionMatrix</a>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">left</strong>
- </td>
- <td class="description last">
- <p>Left boundary of the viewing frustum at the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">right</strong>
- </td>
- <td class="description last">
- <p>Right boundary of the viewing frustum at the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">top</strong>
- </td>
- <td class="description last">
- <p>Top boundary of the viewing frustum at the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">bottom</strong>
- </td>
- <td class="description last">
- <p>Bottom boundary of the viewing frustum at the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">near</strong>
- </td>
- <td class="description last">
- <p>The distance from the camera to the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">far</strong>
- </td>
- <td class="description last">
- <p>The distance from the camera to the far plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">coordinateSystem</strong>
- </td>
- <td class="description last">
- <p>The coordinate system.</p>
- <p>Default is <code>WebGLCoordinateSystem</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">reversedDepth</strong>
- </td>
- <td class="description last">
- <p>Whether to use a reversed depth.</p>
- <p>Default is <code>false</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makePerspective" translate="no">.<a href="#makePerspective">makePerspective</a><span class="signature">( left : <span class="param-type">number</span>, right : <span class="param-type">number</span>, top : <span class="param-type">number</span>, bottom : <span class="param-type">number</span>, near : <span class="param-type">number</span>, far : <span class="param-type">number</span>, coordinateSystem : <span class="param-type"><a href="global.html#WebGLCoordinateSystem">WebGLCoordinateSystem</a> | <a href="global.html#WebGPUCoordinateSystem">WebGPUCoordinateSystem</a></span>, reversedDepth : <span class="param-type">boolean</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Creates a perspective projection matrix. This is used internally by
- <a href="PerspectiveCamera.html#updateProjectionMatrix">PerspectiveCamera#updateProjectionMatrix</a>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">left</strong>
- </td>
- <td class="description last">
- <p>Left boundary of the viewing frustum at the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">right</strong>
- </td>
- <td class="description last">
- <p>Right boundary of the viewing frustum at the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">top</strong>
- </td>
- <td class="description last">
- <p>Top boundary of the viewing frustum at the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">bottom</strong>
- </td>
- <td class="description last">
- <p>Bottom boundary of the viewing frustum at the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">near</strong>
- </td>
- <td class="description last">
- <p>The distance from the camera to the near plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">far</strong>
- </td>
- <td class="description last">
- <p>The distance from the camera to the far plane.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">coordinateSystem</strong>
- </td>
- <td class="description last">
- <p>The coordinate system.</p>
- <p>Default is <code>WebGLCoordinateSystem</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">reversedDepth</strong>
- </td>
- <td class="description last">
- <p>Whether to use a reversed depth.</p>
- <p>Default is <code>false</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeRotationAxis" translate="no">.<a href="#makeRotationAxis">makeRotationAxis</a><span class="signature">( axis : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, angle : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix as a rotational transformation around the given axis by
- the given angle.</p>
- <p>This is a somewhat controversial but mathematically sound alternative to
- rotating via Quaternions. See the discussion <a href="https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199" target="_blank" rel="noopener">here</a>.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">axis</strong>
- </td>
- <td class="description last">
- <p>The normalized rotation axis.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">angle</strong>
- </td>
- <td class="description last">
- <p>The rotation in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeRotationFromEuler" translate="no">.<a href="#makeRotationFromEuler">makeRotationFromEuler</a><span class="signature">( euler : <span class="param-type"><a href="Euler.html">Euler</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the rotation component (the upper left 3x3 matrix) of this matrix to
- the rotation specified by the given Euler angles. The rest of
- the matrix is set to the identity. Depending on the <a href="Euler.html#order">Euler#order</a>,
- there are six possible outcomes. See <a href="https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix" target="_blank" rel="noopener">this page</a>
- for a complete list.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">euler</strong>
- </td>
- <td class="description last">
- <p>The Euler angles.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeRotationFromQuaternion" translate="no">.<a href="#makeRotationFromQuaternion">makeRotationFromQuaternion</a><span class="signature">( q : <span class="param-type"><a href="Quaternion.html">Quaternion</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the rotation component of this matrix to the rotation specified by
- the given Quaternion as outlined <a href="https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion" target="_blank" rel="noopener">here</a>
- The rest of the matrix is set to the identity.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">q</strong>
- </td>
- <td class="description last">
- <p>The Quaternion.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeRotationX" translate="no">.<a href="#makeRotationX">makeRotationX</a><span class="signature">( theta : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix as a rotational transformation around the X axis by
- the given angle.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">theta</strong>
- </td>
- <td class="description last">
- <p>The rotation in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeRotationY" translate="no">.<a href="#makeRotationY">makeRotationY</a><span class="signature">( theta : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix as a rotational transformation around the Y axis by
- the given angle.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">theta</strong>
- </td>
- <td class="description last">
- <p>The rotation in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeRotationZ" translate="no">.<a href="#makeRotationZ">makeRotationZ</a><span class="signature">( theta : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix as a rotational transformation around the Z axis by
- the given angle.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">theta</strong>
- </td>
- <td class="description last">
- <p>The rotation in radians.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeScale" translate="no">.<a href="#makeScale">makeScale</a><span class="signature">( x : <span class="param-type">number</span>, y : <span class="param-type">number</span>, z : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix as a scale transformation.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">x</strong>
- </td>
- <td class="description last">
- <p>The amount to scale in the X axis.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">y</strong>
- </td>
- <td class="description last">
- <p>The amount to scale in the Y axis.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">z</strong>
- </td>
- <td class="description last">
- <p>The amount to scale in the Z axis.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeShear" translate="no">.<a href="#makeShear">makeShear</a><span class="signature">( xy : <span class="param-type">number</span>, xz : <span class="param-type">number</span>, yx : <span class="param-type">number</span>, yz : <span class="param-type">number</span>, zx : <span class="param-type">number</span>, zy : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix as a shear transformation.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">xy</strong>
- </td>
- <td class="description last">
- <p>The amount to shear X by Y.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">xz</strong>
- </td>
- <td class="description last">
- <p>The amount to shear X by Z.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">yx</strong>
- </td>
- <td class="description last">
- <p>The amount to shear Y by X.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">yz</strong>
- </td>
- <td class="description last">
- <p>The amount to shear Y by Z.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">zx</strong>
- </td>
- <td class="description last">
- <p>The amount to shear Z by X.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">zy</strong>
- </td>
- <td class="description last">
- <p>The amount to shear Z by Y.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="makeTranslation" translate="no">.<a href="#makeTranslation">makeTranslation</a><span class="signature">( x : <span class="param-type">number | <a href="Vector3.html">Vector3</a></span>, y : <span class="param-type">number</span>, z : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets this matrix as a translation transform from the given vector.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">x</strong>
- </td>
- <td class="description last">
- <p>The amount to translate in the X axis or alternatively a translation vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">y</strong>
- </td>
- <td class="description last">
- <p>The amount to translate in the Y axis.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">z</strong>
- </td>
- <td class="description last">
- <p>The amount to translate in the z axis.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="multiply" translate="no">.<a href="#multiply">multiply</a><span class="signature">( m : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Post-multiplies this matrix by the given 4x4 matrix.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">m</strong>
- </td>
- <td class="description last">
- <p>The matrix to multiply with.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="multiplyMatrices" translate="no">.<a href="#multiplyMatrices">multiplyMatrices</a><span class="signature">( a : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span>, b : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Multiples the given 4x4 matrices and stores the result
- in this matrix.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">a</strong>
- </td>
- <td class="description last">
- <p>The first matrix.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">b</strong>
- </td>
- <td class="description last">
- <p>The second matrix.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="multiplyScalar" translate="no">.<a href="#multiplyScalar">multiplyScalar</a><span class="signature">( s : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Multiplies every component of the matrix by the given scalar.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">s</strong>
- </td>
- <td class="description last">
- <p>The scalar.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="premultiply" translate="no">.<a href="#premultiply">premultiply</a><span class="signature">( m : <span class="param-type"><a href="Matrix4.html">Matrix4</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Pre-multiplies this matrix by the given 4x4 matrix.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">m</strong>
- </td>
- <td class="description last">
- <p>The matrix to multiply with.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="scale" translate="no">.<a href="#scale">scale</a><span class="signature">( v : <span class="param-type"><a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Multiplies the columns of this matrix by the given vector.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">v</strong>
- </td>
- <td class="description last">
- <p>The scale vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="set" translate="no">.<a href="#set">set</a><span class="signature">( n11 : <span class="param-type">number</span>, n12 : <span class="param-type">number</span>, n13 : <span class="param-type">number</span>, n14 : <span class="param-type">number</span>, n21 : <span class="param-type">number</span>, n22 : <span class="param-type">number</span>, n23 : <span class="param-type">number</span>, n24 : <span class="param-type">number</span>, n31 : <span class="param-type">number</span>, n32 : <span class="param-type">number</span>, n33 : <span class="param-type">number</span>, n34 : <span class="param-type">number</span>, n41 : <span class="param-type">number</span>, n42 : <span class="param-type">number</span>, n43 : <span class="param-type">number</span>, n44 : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the elements of the matrix.The arguments are supposed to be
- in row-major order.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">n11</strong>
- </td>
- <td class="description last">
- <p>1-1 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n12</strong>
- </td>
- <td class="description last">
- <p>1-2 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n13</strong>
- </td>
- <td class="description last">
- <p>1-3 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n14</strong>
- </td>
- <td class="description last">
- <p>1-4 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n21</strong>
- </td>
- <td class="description last">
- <p>2-1 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n22</strong>
- </td>
- <td class="description last">
- <p>2-2 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n23</strong>
- </td>
- <td class="description last">
- <p>2-3 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n24</strong>
- </td>
- <td class="description last">
- <p>2-4 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n31</strong>
- </td>
- <td class="description last">
- <p>3-1 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n32</strong>
- </td>
- <td class="description last">
- <p>3-2 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n33</strong>
- </td>
- <td class="description last">
- <p>3-3 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n34</strong>
- </td>
- <td class="description last">
- <p>3-4 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n41</strong>
- </td>
- <td class="description last">
- <p>4-1 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n42</strong>
- </td>
- <td class="description last">
- <p>4-2 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n43</strong>
- </td>
- <td class="description last">
- <p>4-3 matrix element.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">n44</strong>
- </td>
- <td class="description last">
- <p>4-4 matrix element.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setFromMatrix3" translate="no">.<a href="#setFromMatrix3">setFromMatrix3</a><span class="signature">( m : <span class="param-type"><a href="Matrix3.html">Matrix3</a></span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Set the upper 3x3 elements of this matrix to the values of given 3x3 matrix.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">m</strong>
- </td>
- <td class="description last">
- <p>The 3x3 matrix.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="setPosition" translate="no">.<a href="#setPosition">setPosition</a><span class="signature">( x : <span class="param-type">number | <a href="Vector3.html">Vector3</a></span>, y : <span class="param-type">number</span>, z : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Sets the position component for this matrix from the given vector,
- without affecting the rest of the matrix.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">x</strong>
- </td>
- <td class="description last">
- <p>The x component of the vector or alternatively the vector object.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">y</strong>
- </td>
- <td class="description last">
- <p>The y component of the vector.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">z</strong>
- </td>
- <td class="description last">
- <p>The z component of the vector.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="toArray" translate="no">.<a href="#toArray">toArray</a><span class="signature">( array : <span class="param-type">Array.<number></span>, offset : <span class="param-type">number</span> )</span><span class="type-signature"> : Array.<number></span> </h3>
- <div class="method">
- <div class="description">
- <p>Writes the elements of this matrix to the given array. If no array is provided,
- the method returns a new instance.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong translate="no">array</strong>
- </td>
- <td class="description last">
- <p>The target array holding the matrix elements in column-major order.</p>
- <p>Default is <code>[]</code>.</p>
- </td>
- </tr>
- <tr>
- <td class="name">
- <strong translate="no">offset</strong>
- </td>
- <td class="description last">
- <p>Index of the first element in the array.</p>
- <p>Default is <code>0</code>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> The matrix elements in column-major order.</dt>
- </dl>
- </div>
- <h3 class="name name-method" id="transpose" translate="no">.<a href="#transpose">transpose</a><span class="signature">()</span><span class="type-signature"> : <a href="Matrix4.html">Matrix4</a></span> </h3>
- <div class="method">
- <div class="description">
- <p>Transposes this matrix in place.</p>
- </div>
- <dl class="details">
- <dt class="tag-returns"><strong>Returns:</strong> A reference to this matrix.</dt>
- </dl>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/math/Matrix4.js" translate="no" target="_blank" rel="noopener">src/math/Matrix4.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|