Matrix4.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <h1>[name]</h1>
  2. <div class="desc">A 4x4 Matrix.</div>
  3. <h2>Example</h2>
  4. <code>// Simple rig for rotating around 3 axes
  5. var m = new THREE.Matrix4();
  6. var m1 = new THREE.Matrix4();
  7. var m2 = new THREE.Matrix4();
  8. var m3 = new THREE.Matrix4();
  9. var alpha = 0;
  10. var beta = Math.PI;
  11. var gamma = Math.PI/2;
  12. m1.setRotationX( alpha );
  13. m2.setRotationY( beta );
  14. m3.setRotationZ( gamma );
  15. m.multiply( m1, m2 );
  16. m.multiplySelf( m3 );
  17. </code>
  18. <h2>Constructor</h2>
  19. <h3>[name]( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] )</h3>
  20. <h2>Properties</h2>
  21. <h3>.[page:Float n11]</h3>
  22. <h3>.[page:Float n12]</h3>
  23. <h3>.[page:Float n13]</h3>
  24. <h3>.[page:Float n14]</h3>
  25. <h3>.[page:Float n21]</h3>
  26. <h3>.[page:Float n22]</h3>
  27. <h3>.[page:Float n23]</h3>
  28. <h3>.[page:Float n24]</h3>
  29. <h3>.[page:Float n31]</h3>
  30. <h3>.[page:Float n32]</h3>
  31. <h3>.[page:Float n33]</h3>
  32. <h3>.[page:Float n34]</h3>
  33. <h3>.[page:Float n41]</h3>
  34. <h3>.[page:Float n42]</h3>
  35. <h3>.[page:Float n43]</h3>
  36. <h3>.[page:Float n44]</h3>
  37. <h2>Methods</h2>
  38. <h3>.set( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] ) [page:Matrix4]</h3>
  39. <div>
  40. Sets all fields of this matrix.
  41. </div>
  42. <h3>.identity() [page:Matrix4]</h3>
  43. <div>
  44. Resets this matrix to identity.
  45. </div>
  46. <h3>.copy( [page:Matrix4 m] ) [page:Matrix4]</h3>
  47. <div>
  48. Copies a matrix <strong>m</strong> into this matrix.
  49. </div>
  50. <h3>.lookAt( [page:Vector3 eye], [page:Vector3 center], [page:Vector3 up], ) [page:Matrix4]</h3>
  51. <div>
  52. Constructs a rotation matrix, looking from <strong>eye</strong> towards <strong>center</strong> with defined <strong>up</strong> vector.
  53. </div>
  54. <h3>.multiply( [page:Matrix4 a], [page:Matrix4 b] ) [page:Matrix4]</h3>
  55. <div>
  56. Sets this matrix to <strong>a * b</strong>.
  57. </div>
  58. <h3>.multiplySelf( [page:Matrix4 m] ) [page:Matrix4]</h3>
  59. <div>
  60. Multiplies this matrix by <strong>m</strong>.
  61. </div>
  62. <h3>.multiplyToArray( [page:Matrix4 a], [page:Matrix4 b], [page:Array r] ) [page:Matrix4]</h3>
  63. <div>
  64. Sets this matrix to <strong>a * b</strong> and sets result into flat array <strong>r</strong>.<br />
  65. Destination array can be regular Array or TypedArray.
  66. </div>
  67. <h2>Source</h2>
  68. <a href="https://github.com/mrdoob/three.js/blob/master/src/[path].js" target="_blank">src/[path].js</a>