123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921 |
- <!DOCTYPE html>
- <html lang="it">
- <head>
- <meta charset="utf-8" />
- <base href="../../../" />
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>[name]</h1>
- <p class="desc">
- Una classe che rappresenta una [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrice] 4x4.<br /><br />
- L'uso più comune di una matrice 4x4 nella grafica 3D è come una
- [link:https://en.wikipedia.org/wiki/Transformation_matrix matrice di trasformazione].
-
- Per un'introduzione alle matrici di trasformazione utilizzate in WebGL,
- dai un'occhiata a [link:http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices questo tutorial].<br /><br />
- Ciò consente ad un [page:Vector3] che rappresenta un punto nello spazio 3D di subire trasformazioni come traslazione, rotazione
- taglio, scala, riflessione, proiezione ortogonale o prospettica e così via, moltiplicandosi per la matrice.
- Questo è noto come `applicare` la matrice al vettore.<br /><br />
- Ogni [page:Object3D] ha tre Matrix4 associate:
- <ul>
- <li>
- [page:Object3D.matrix]: Questo memorizza la trasfomazione locale dell'oggetto. Questa è la trasformazione dell'oggetto rispetto al suo genitore.
- </li>
- <li>
- [page:Object3D.matrixWorld]: La trasformazione globale o world dell'oggetto. Se l'oggetto non ha un genitore, allora questo è identico
- alla trasformazione locale memorizzata nella [page:Object3D.matrix matrix].
- </li>
- <li>
- [page:Object3D.modelViewMatrix]: Questo rappresenta la trasformazione dell'oggetto rispetto al sistema di coordinate della telecamera.
- Il modelViewMatrix dell'oggetto è il matrixWorld dell'oggetto pre-moltiplicato per il matrixWorldInverse della telecamera.
- </li>
- </ul>
- Le [page:Camera Telecamere] hanno tre Matrix4 addizionali:
- <ul>
- <li>
- [page:Camera.matrixWorldInverse]: La matrice di visualizzazione - l'inversa della [page:Object3D.matrixWorld matrixWorld] della telecamera.
- </li>
- <li>
- [page:Camera.projectionMatrix]: Rappresenta le informazioni su come proiettare la scena nello spazio di ritaglio.
- </li>
- <li>
- [page:Camera.projectionMatrixInverse]: L'inverso della projectionMatrix.
- </li>
- </ul>
- Nota: [page:Object3D.normalMatrix] non è una Matrix4, ma una [page:Matrix3].
- </p>
- <h2>Una nota sull'ordine delle Row-Major (righe principali) e delle Column-Major (colonne principali)</h2>
- <p>
- Il metodo [page:.set set]() accetta gli argomenti in ordine
- [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major], mentre internamente
- vengono memorizzati nell'array [page:.elements elements] nell'ordine column-major.<br /><br />
- Ciò significa che la chiamata a
- <code>
- const m = new THREE.Matrix4();
- m.set( 11, 12, 13, 14,
- 21, 22, 23, 24,
- 31, 32, 33, 34,
- 41, 42, 43, 44 );
- </code>
- risulterà nell'array [page:.elements elements] contenente:
- <code>
- m.elements = [ 11, 21, 31, 41,
- 12, 22, 32, 42,
- 13, 23, 33, 43,
- 14, 24, 34, 44 ];
- </code>
- e internamente tutti i calcoli vengono eseguiti utilizzando l'ordine column-major. Tuttavia, poiché l'ordine
- effettivo non fa alcune differenza matematicamente e la maggior parte delle persone è abituata a pensare alle
- matrici nell'ordine row-major, la documentazione di three.js mostra le matrici in ordine di row-major.
- Tieni solo a mente che se stai leggendo il codice sorgente, dovrai prendere la [link:https://en.wikipedia.org/wiki/Transpose trasposizione]
- di tutte le matrici qui descritte per dare un senso ai calcoli.
- </p>
- <h2>Estrazione della posizione, della rotazione e del ridimensionamento</h2>
- <p>
- Ci sono molte opzioni disponibili per l'estrazione della posizione, della rotazione e del ridimensionamento da una Matrix4.
- <ul>
- <li>
- [page:Vector3.setFromMatrixPosition]: può essere utilizzato per estrarre il componente traslazione.
- </li>
- <li>
- [page:Vector3.setFromMatrixScale]: può essere utilizzato per estrarre il componente ridimensionamento.
- </li>
- <li>
- [page:Quaternion.setFromRotationMatrix], [page:Euler.setFromRotationMatrix] o [page:.extractRotation extractRotation]
- può essere utilizzato per estrarre il componente rotazione da una matrice pura (non ridimensionata).
- </li>
- <li>
- [page:.decompose decompose] può essere utilizzato per estrarre la posizione, la rotazione e il ridemsionamento tutti in uno.
- </li>
- </ul>
- </p>
- <h2>Costruttore</h2>
- <h3>[name]( [param:Number n11], [param:Number n12], [param:Number n13], [param:Number n14],
- [param:Number n21], [param:Number n22], [param:Number n23], [param:Number n24],
- [param:Number n31], [param:Number n32], [param:Number n33], [param:Number n34],
- [param:Number n41], [param:Number n42], [param:Number n43], [param:Number n44] )</h3>
- <p>
- Creates a 4x4 matrix with the given arguments in row-major order. If no arguments are provided, the constructor initializes
- the [name] to the 4x4 [link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
- </p>
- <h2>Proprietà</h2>
- <h3>[property:Array elements]</h3>
- <p>
- Una lista di [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]
- di valori della matrice.
- </p>
- <h2>Metodi</h2>
- <h3>[method:Matrix4 clone]()</h3>
- <p>Crea una nuova Matrix4 con gli [page:.elements elementi] identici a questa.</p>
- <h3>[method:this compose]( [param:Vector3 position], [param:Quaternion quaternion], [param:Vector3 scale] )</h3>
- <p>
- Imposta questa matrice sulla trasformazione composta da [page:Vector3 posizione],
- [page:Quaternion quaternione] e [page:Vector3 ridimensionamento].
- </p>
- <h3>[method:this copy]( [param:Matrix4 m] )</h3>
- <p>Copia gli [page:.elements elementi] della matrice [page:Matrix4 m] in questa matrice.</p>
- <h3>[method:this copyPosition]( [param:Matrix4 m] )</h3>
- <p>
- Copia il componente traslazione della matrice [page:Matrix4 m] fornita nel componente
- trasformazione di questa matrice.
- </p>
- <h3>[method:this decompose]( [param:Vector3 position], [param:Quaternion quaternion], [param:Vector3 scale] )</h3>
- <p>
- Decompone questa matrice nei suoi componenti [page:Vector3 posizione], [page:Quaternion quaternione] e [page:Vector3 ridimensionamento].<br/><br/>
- Nota: Non tutte le matrici si possono scomporre in questo modo. Per esempio, se un oggetto ha un genitore ridimensionato non uniformemente,
- allora la matrice del mondo dell'oggetto potrebbe non essere scomponibile e questo metodo potrebbe non essere appropriato.
- </p>
- <h3>[method:Float determinant]()</h3>
- <p>
- Calcola e restituisce il
- [link:https://en.wikipedia.org/wiki/Determinant determinante] di questa matrice.<br /><br />
- Sulla base del metodo [link:http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm qui] descritto.
- </p>
- <h3>[method:Boolean equals]( [param:Matrix4 m] )</h3>
- <p>Restituisce true se questa matrice e [page:Matrix4 m] sono uguali.</p>
- <h3>[method:this extractBasis]( [param:Vector3 xAxis], [param:Vector3 yAxis], [param:Vector3 zAxis] )</h3>
- <p>
- Estrae la [link:https://en.wikipedia.org/wiki/Basis_(linear_algebra) base] di questa matrice
- nei tre vettori asse forniti. Se questa matrice è:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd><mi>a</mi></mtd>
- <mtd><mi>b</mi></mtd>
- <mtd><mi>c</mi></mtd>
- <mtd><mi>d</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>e</mi></mtd>
- <mtd><mi>f</mi></mtd>
- <mtd><mi>g</mi></mtd>
- <mtd><mi>h</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>i</mi></mtd>
- <mtd><mi>j</mi></mtd>
- <mtd><mi>k</mi></mtd>
- <mtd><mi>l</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>m</mi></mtd>
- <mtd><mi>n</mi></mtd>
- <mtd><mi>o</mi></mtd>
- <mtd><mi>p</mi></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <p>
- then the [page:Vector3 xAxis], [page:Vector3 yAxis], [page:Vector3 zAxis]
- will be set to:
- </p>
- <div style="text-align: center">
- <math>
- <mrow>
- <mi>xAxis</mi>
- <mo>=</mo>
- <mo>[</mo>
- <mtable>
- <mtr><mtd style="height: 1rem"><mi>a</mi></mtd></mtr>
- <mtr><mtd style="height: 1rem"><mi>e</mi></mtd></mtr>
- <mtr><mtd style="height: 1rem"><mi>i</mi></mtd></mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>,
- <math>
- <mrow>
- <mi>yAxis</mi>
- <mo>=</mo>
- <mo>[</mo>
- <mtable>
- <mtr><mtd style="height: 1rem"><mi>b</mi></mtd></mtr>
- <mtr><mtd style="height: 1rem"><mi>f</mi></mtd></mtr>
- <mtr><mtd style="height: 1rem"><mi>j</mi></mtd></mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>, and
- <math>
- <mrow>
- <mi>zAxis</mi>
- <mo>=</mo>
- <mo>[</mo>
- <mtable>
- <mtr><mtd style="height: 1rem"><mi>c</mi></mtd></mtr>
- <mtr><mtd style="height: 1rem"><mi>g</mi></mtd></mtr>
- <mtr><mtd style="height: 1rem"><mi>k</mi></mtd></mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- </div>
- <h3>[method:this extractRotation]( [param:Matrix4 m] )</h3>
- <p>
- Estrae il componente rotazione della matrice [page:Matrix4 m] fornita nel componente rotazione di questa matrice.
- </p>
- <h3>[method:this fromArray]( [param:Array array], [param:Integer offset] )</h3>
- <p>
- [page:Array array] - l'array da cui leggere gli elementi.<br />
- [page:Integer offset] - (opzionale) indice del primo elemento nell'array. Il valore predefinito è 0.<br /><br />
- Imposta gli elementi di questa matrice in base ad un array nel formato
- [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major].
- </p>
- <h3>[method:this invert]()</h3>
- <p>
- Inverte questa matrice, utilizzando il [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution metodo analitico].
- Non puoi invertire con un determinante zero. Se si tenta questo, il metodo produce invece una matrice zero.
- </p>
- <h3>[method:Float getMaxScaleOnAxis]()</h3>
- <p>Ottiene il valore di ridimensionamento massimo dei 3 assi.</p>
- <h3>[method:this identity]()</h3>
- <p>Reimposta questa matrice alla [link:https://en.wikipedia.org/wiki/Identity_matrix matrice] identità.</p>
- <h3>[method:this lookAt]( [param:Vector3 eye], [param:Vector3 target], [param:Vector3 up] )</h3>
- <p>
- Costruisce una matrice di rotazione, guardando dall'[page:Vector3 occhio] verso il [page:Vector3 target] orientato dal
- vettore verso l'[page:Vector3 alto].
- </p>
- <h3>[method:this makeRotationAxis]( [param:Vector3 axis], [param:Float theta] )</h3>
- <p>
- [page:Vector3 axis] — Asse di rotazione, deve essere normalizzata.<br />
- [page:Float theta] — Angolo di rotazione in radianti.<br /><br />
- Imposta questa matrice come trasformazione di rotazione attorno all'[page:Vector3 asse] di [page:Float theta] radianti.<br />
- Questa è un'alternativa alquanto controversa ma matematicamente valida alla rotazione tramite [page:Quaternion Quaternions].
- Vedi la discussione [link:https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199 qui].
- </p>
- <h3>[method:this makeBasis]( [param:Vector3 xAxis], [param:Vector3 yAxis], [param:Vector3 zAxis] )</h3>
- <p>
- Imposta questo sulla matrice di [link:https://en.wikipedia.org/wiki/Basis_(linear_algebra) base] composta dai tre
- vettori di base forniti:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd><mi>xAxis.x</mi></mtd>
- <mtd><mi>yAxis.x</mi></mtd>
- <mtd><mi>zAxis.x</mi></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mi>xAxis.y</mi></mtd>
- <mtd><mi>yAxis.y</mi></mtd>
- <mtd><mi>zAxis.y</mi></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mi>xAxis.z</mi></mtd>
- <mtd><mi>yAxis.z</mi></mtd>
- <mtd><mi>zAxis.z</mi></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:this makePerspective]( [param:Float left], [param:Float right], [param:Float top], [param:Float bottom], [param:Float near], [param:Float far] )</h3>
- <p>
- Crea una matrice di [link:https://en.wikipedia.org/wiki/3D_projection#Perspective_projection proiezione prospettica].
- Questa è utilizzata internamente da [page:PerspectiveCamera.updateProjectionMatrix]().
- </p>
- <h3>[method:this makeOrthographic]( [param:Float left], [param:Float right], [param:Float top], [param:Float bottom], [param:Float near], [param:Float far] )</h3>
- <p>
- Crea una matrice di [link:https://en.wikipedia.org/wiki/Orthographic_projection proiezione ortografica].
- Questa è utilizzata internamente da [page:OrthographicCamera.updateProjectionMatrix]().
- </p>
- <h3>[method:this makeRotationFromEuler]( [param:Euler euler] )</h3>
- <p>
- Imposta il componente rotazione (la matrice 3x3 in alto a sinistra) di questa matrice sulla rotazione specificata dal dato [page:Euler Angolo di Eulero].
- Il resto della matrice è impostato sull'identità. A seconda dell'[page:Euler.order ordine] di [page:Euler Eulero], ci sono sei possibili esisti.
- Vedi [link:https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix questa pagina] per una lista completa.
- </p>
- <h3>[method:this makeRotationFromQuaternion]( [param:Quaternion q] )</h3>
- <p>
- Imposta il componente rotazinoe di questa matrice alla rotazione specificata da [page:Quaternion q], come
- descritto [link:https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion qui].
- Il resto della matrice è impostato all'identità. Quindi, dato [page:Quaternion q] = w + xi + yj + zk, la matrice risultante sarà:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd>
- <mn>1</mn>
- <mo>-</mo>
- <mn>2</mn>
- <msup>
- <mi>y</mi>
- <mn>2</mn>
- </msup>
- <mo>-</mo>
- <mn>2</mn>
- <msup>
- <mi>z</mi>
- <mn>2</mn>
- </msup>
- </mtd>
- <mtd>
- <mn>2</mn>
- <mi>x</mi>
- <mi>y</mi>
- <mo>-</mo>
- <mn>2</mn>
- <mi>z</mi>
- <mi>w</mi>
- </mtd>
- <mtd>
- <mn>2</mn>
- <mi>x</mi>
- <mi>z</mi>
- <mo>+</mo>
- <mn>2</mn>
- <mi>y</mi>
- <mi>w</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd>
- <mn>2</mn>
- <mi>x</mi>
- <mi>y</mi>
- <mo>+</mo>
- <mn>2</mn>
- <mi>z</mi>
- <mi>w</mi>
- </mtd>
- <mtd>
- <mn>1</mn>
- <mo>-</mo>
- <mn>2</mn>
- <msup>
- <mi>x</mi>
- <mn>2</mn>
- </msup>
- <mo>-</mo>
- <mn>2</mn>
- <msup>
- <mi>z</mi>
- <mn>2</mn>
- </msup>
- </mtd>
- <mtd>
- <mn>2</mn>
- <mi>y</mi>
- <mi>z</mi>
- <mo>-</mo>
- <mn>2</mn>
- <mi>x</mi>
- <mi>w</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd>
- <mn>2</mn>
- <mi>x</mi>
- <mi>z</mi>
- <mo>-</mo>
- <mn>2</mn>
- <mi>y</mi>
- <mi>w</mi>
- </mtd>
- <mtd>
- <mn>2</mn>
- <mi>y</mi>
- <mi>z</mi>
- <mo>+</mo>
- <mn>2</mn>
- <mi>x</mi>
- <mi>w</mi>
- </mtd>
- <mtd>
- <mn>1</mn>
- <mo>-</mo>
- <mn>2</mn>
- <msup>
- <mi>x</mi>
- <mn>2</mn>
- </msup>
- <mo>-</mo>
- <mn>2</mn>
- <msup>
- <mi>y</mi>
- <mn>2</mn>
- </msup>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:this makeRotationX]( [param:Float theta] )</h3>
- <p>
- [page:Float theta] — Angolo rotazione in radianti.<br /><br />
- Imposta questa matrice come una trasformazione rotazionale attorno all'asse X in radianti theta [page:Float theta] (θ).
- La matrice risultante sarà:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd><mn>1</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd>
- <mn>0</mn>
- </mtd>
- <mtd>
- <mi>cos</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mo>-</mo>
- <mi>sin</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd>
- <mn>0</mn>
- </mtd>
- <mtd>
- <mi>sin</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mi>cos</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:this makeRotationY]( [param:Float theta] )</h3>
- <p>
- [page:Float theta] — Angolo rotazione in radianti.<br /><br />
- Imposta questa matrice come una trasformazione rotazionale attorno all'asse Y in radianti theta [page:Float theta] (θ).
- La matrice risultante sarà:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd>
- <mi>cos</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- <mtd>
- <mi>sin</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd>
- <mo>-</mo>
- <mi>sin</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- <mtd>
- <mi>cos</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:this makeRotationZ]( [param:Float theta] )</h3>
- <p>
- [page:Float theta] — Angolo rotazione in radianti.<br /><br />
- Imposta questa matrice come una trasformazione rotazionale attorno all'asse Z in radianti theta [page:Float theta] (θ).
- La matrice risultante sarà:
- </p>
-
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd>
- <mi>cos</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mo>-</mo>
- <mi>sin</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd>
- <mi>sin</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mi>cos</mi>
- <mi>θ</mi>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- <mtd>
- <mn>0</mn>
- </mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:this makeScale]( [param:Float x], [param:Float y], [param:Float z] )</h3>
- <p>
- [page:Float x] - la quantità da scalare sull'asse X.<br />
- [page:Float y] - la quantità da scalare sull'asse Y.<br />
- [page:Float z] - la quantità da scalare sull'asse Z.<br /><br />
- Imposta questa matrice come trasformazione di scala:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd><mi>x</mi></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mi>y</mi></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mi>z</mi></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:this makeShear]( [param:Float xy], [param:Float xz], [param:Float yx], [param:Float yz], [param:Float zx], [param:Float zy] )</h3>
- <p>
- [page:Float xy] - la quantità di taglio di X per Y.<br />
- [page:Float xz] - la quantità di taglio di X per Z.<br />
- [page:Float yx] - la quantità di taglio di Y per X.<br />
- [page:Float yz] - la quantità di taglio di Y per Z.<br />
- [page:Float zx] - la quantità di taglio di Z per X.<br />
- [page:Float zy] - la quantità di taglio di Z per Y.<br /><br />
- Imposta questa matrice come trasformata di taglio:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd><mn>1</mn></mtd>
- <mtd><mi>y</mi><mi>x</mi></mtd>
- <mtd><mi>z</mi><mi>x</mi></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mi>x</mi><mi>y</mi></mtd>
- <mtd><mn>1</mn></mtd>
- <mtd><mi>z</mi><mi>y</mi></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mi>x</mi><mi>z</mi></mtd>
- <mtd><mi>y</mi><mi>z</mi></mtd>
- <mtd><mn>1</mn></mtd>
- <mtd><mn>0</mn></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:this makeTranslation]( [param:Vector3 v] )</h3>
- <h3>
- [method:this makeTranslation]( [param:Float x], [param:Float y], [param:Float z] ) // optional API
- </h3>
- <p>
- Imposta questa matrice come una trasformata di traslazione dal vettore [page:Vector3 v]:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd><mn>1</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mi>x</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mi>y</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- <mtd><mi>z</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>0</mn></mtd>
- <mtd><mn>1</mn></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:this multiply]( [param:Matrix4 m] )</h3>
- <p>Post-moltiplica questa matrice per [page:Matrix4 m].</p>
- <h3>[method:this multiplyMatrices]( [param:Matrix4 a], [param:Matrix4 b] )</h3>
- <p>Imposta questa matrice a [page:Matrix4 a] x [page:Matrix4 b].</p>
- <h3>[method:this multiplyScalar]( [param:Float s] )</h3>
- <p>Moltiplica ogni componente della matrice per il valore scalare [page:Float s].</p>
- <h3>[method:this premultiply]( [param:Matrix4 m] )</h3>
- <p>Pre-moltiplica questa matrice per [page:Matrix4 m].</p>
- <h3>[method:this scale]( [param:Vector3 v] )</h3>
- <p>Moltiplica le colonne di questa matrice per il vettore [page:Vector3 v].</p>
- <h3>[method:this set]( [param:Float n11], [param:Float n12], [param:Float n13], [param:Float n14], [param:Float n21], [param:Float n22], [param:Float n23], [param:Float n24], [param:Float n31], [param:Float n32], [param:Float n33], [param:Float n34], [param:Float n41], [param:Float n42], [param:Float n43], [param:Float n44] )</h3>
- <p>
- Imposta gli [page:.elements elementi] di questa matrice ai valori principali di row-major forniti [page:Float n11],
- [page:Float n12], ... [page:Float n44].
- </p>
- <h3>[method:this setFromMatrix3]( [param:Matrix3 m] )</h3>
- <p>Imposta gli elementi 3x3 superiori di questa matrice sui valori di Matrix3 [page:Matrix3 m].</p>
- <h3>[method:this setPosition]( [param:Vector3 v] )</h3>
- <h3>[method:this setPosition]( [param:Float x], [param:Float y], [param:Float z] ) // optional API</h3>
- <p>
- Imposta la componente posizione per questa matrice dal vettore [page:Vector3 v], senza influenzare
- il resto della matrice - ovvero se la matrice è attulmente:
- </p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd><mi>a</mi></mtd>
- <mtd><mi>b</mi></mtd>
- <mtd><mi>c</mi></mtd>
- <mtd><mi>d</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>e</mi></mtd>
- <mtd><mi>f</mi></mtd>
- <mtd><mi>g</mi></mtd>
- <mtd><mi>h</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>i</mi></mtd>
- <mtd><mi>j</mi></mtd>
- <mtd><mi>k</mi></mtd>
- <mtd><mi>l</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>m</mi></mtd>
- <mtd><mi>n</mi></mtd>
- <mtd><mi>o</mi></mtd>
- <mtd><mi>p</mi></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <p>Questa diventa:</p>
- <math display="block">
- <mrow>
- <mo>[</mo>
- <mtable>
- <mtr>
- <mtd><mi>a</mi></mtd>
- <mtd><mi>b</mi></mtd>
- <mtd><mi>c</mi></mtd>
- <mtd><mi>v.x</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>e</mi></mtd>
- <mtd><mi>f</mi></mtd>
- <mtd><mi>g</mi></mtd>
- <mtd><mi>v.y</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>i</mi></mtd>
- <mtd><mi>j</mi></mtd>
- <mtd><mi>k</mi></mtd>
- <mtd><mi>v.z</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>m</mi></mtd>
- <mtd><mi>n</mi></mtd>
- <mtd><mi>o</mi></mtd>
- <mtd><mi>p</mi></mtd>
- </mtr>
- </mtable>
- <mo>]</mo>
- </mrow>
- </math>
- <h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
- <p>
- [page:Array array] - (opzionale) array per memorizzare il vettore risultante.<br />
- [page:Integer offset] - (opzionale) offset nell'array in cui inserire il risultato.<br /><br />
-
- Scrive gli elementi di questa matrice in una matrice in formato
- [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major].
- </p>
- <h3>[method:this transpose]()</h3>
- <p>[link:https://en.wikipedia.org/wiki/Transpose Traspone] questa matrice.</p>
- <h2>Source</h2>
- <p>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </p>
- </body>
- </html>
|