Difference between revisions of "Matrix"
 (Created page with "__NOTOC__ '''Supported platforms:''' <br/> '''Available since:''' Gideros 2011.6<br/> === Description === <br /> The Matrix class specifies transformation from one coordinate...")  | 
				|||
| Line 1: | Line 1: | ||
__NOTOC__  | __NOTOC__  | ||
| − | '''Supported platforms:''' <br/>  | + | '''Supported platforms:''' android, ios, mac, pc<br/>  | 
'''Available since:''' Gideros 2011.6<br/>  | '''Available since:''' Gideros 2011.6<br/>  | ||
=== Description ===  | === Description ===  | ||
| Line 15: | Line 15: | ||
<br />  | <br />  | ||
| − | Since Gideros 2016.6, Matrix can also hold 3D (4x4) matrices.{|-  | + | Since Gideros 2016.6, Matrix can also hold 3D (4x4) matrices.  | 
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | {|-  | ||
| style="width: 50%;"|  | | style="width: 50%;"|  | ||
=== Methods ===  | === Methods ===  | ||
| + | [[Matrix.new]] - creates a new Matrix object<br/>  | ||
| + | [[Matrix:getAnchorPosition]] - get anchor position from matrix transformation<br/>  | ||
| + | [[Matrix:getElements]] - returns the elements of this matrix instance<br/>  | ||
| + | [[Matrix:getM11]] - returns the value of the m11 component<br/>  | ||
| + | [[Matrix:getM12]] - returns the value of the m12 component<br/>  | ||
| + | [[Matrix:getM21]] - returns the value of the m21 component<br/>  | ||
| + | [[Matrix:getM22]] - returns the value of the m22 component<br/>  | ||
| + | [[Matrix:getMatrix]] - get all 16 elements of 4x4 matrix<br/>  | ||
| + | [[Matrix:getPosition]] - get position from matrix transformation<br/>  | ||
| + | [[Matrix:getRotationX]] - get rotation for x axis<br/>  | ||
| + | [[Matrix:getRotationY]] - get rotation on y axis<br/>  | ||
| + | [[Matrix:getRotationZ]] - get rotation for z axis<br/>  | ||
| + | [[Matrix:getScale]] - get scale from matrix transformation<br/>  | ||
| + | [[Matrix:getScaleX]] - get scale on x axis<br/>  | ||
| + | [[Matrix:getScaleY]] - get scale on y axis<br/>  | ||
| + | [[Matrix:getScaleZ]] - get scale on z axis<br/>  | ||
| + | [[Matrix:getTx]] - returns the value of the tx component<br/>  | ||
| + | [[Matrix:getTy]] - returns the value of the ty component<br/>  | ||
| + | [[Matrix:getTz]] - returns the value of the tz component<br/>  | ||
| + | [[Matrix:getX]] - get x position<br/>  | ||
| + | [[Matrix:getY]] - get y position<br/>  | ||
| + | [[Matrix:getZ]] - get z position<br/>  | ||
| + | [[Matrix:invert]] - <br/>  | ||
| + | [[Matrix:multiply]] - Multiply current matrix with new one<br/>  | ||
| + | [[Matrix:orthographicProjection]] - <br/>  | ||
| + | [[Matrix:perspectiveProjection]] - <br/>  | ||
| + | [[Matrix:perspectiveProjection]] - <br/>  | ||
| + | [[Matrix:rotate]] - combine existing rotation with provided<br/>  | ||
| + | [[Matrix:scale]] - combine existing scale with provided scale<br/>  | ||
| + | [[Matrix:setAnchorPosition]] - transform matrix for setting anchor position<br/>  | ||
| + | [[Matrix:setElements]] - sets all 6 elements of this matrix instance<br/>  | ||
| + | [[Matrix:setM11]] - sets the value of the m11 component<br/>  | ||
| + | [[Matrix:setM12]] - sets the value of the m22 component<br/>  | ||
| + | [[Matrix:setM21]] - <br/>  | ||
| + | [[Matrix:setM22]] - <br/>  | ||
| + | [[Matrix:setMatrix]] - set all 16 elements of 4x4 matrix<br/>  | ||
| + | [[Matrix:setPosition]] - transform matrix for setting position<br/>  | ||
| + | [[Matrix:setRotationX]] - set rotation on x axis<br/>  | ||
| + | [[Matrix:setRotationY]] - set rotation on y axis<br/>  | ||
| + | [[Matrix:setRotationZ]] - set rotation on z axis<br/>  | ||
| + | [[Matrix:setScale]] - transform matrix for setting scale<br/>  | ||
| + | [[Matrix:setScaleX]] - set scale on x axis<br/>  | ||
| + | [[Matrix:setScaleY]] - set scale on y axis<br/>  | ||
| + | [[Matrix:setScaleZ]] - set scale on z axis<br/>  | ||
| + | [[Matrix:setTx]] - sets the value of the tx component<br/>  | ||
| + | [[Matrix:setTy]] - sets the value of the ty component<br/>  | ||
| + | [[Matrix:setTz]] - sets the value of the tz component<br/>  | ||
| + | [[Matrix:setX]] - set x position<br/>  | ||
| + | [[Matrix:setY]] - set y position<br/>  | ||
| + | [[Matrix:setZ]] - set z position<br/>  | ||
| + | [[Matrix:transformPoint]] - <br/>  | ||
| + | [[Matrix:translate]] - combine existing translation with provided translation<br/>  | ||
| style="width: 50%;"|  | | style="width: 50%;"|  | ||
=== Events ===  | === Events ===  | ||
=== Constants ===  | === Constants ===  | ||
|}  | |}  | ||
Revision as of 08:56, 23 August 2018
Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6
Description
The Matrix class specifies transformation from one coordinate space to another.
These transformations include translation, rotation, scaling and skewing.
A 2D transformation matrix is a 3 x 3 matrix in homogenous coordinate system:
![images/matrix_props.png]
You can get and set the values of all six of the properties in a
Matrix object: `m11`, `m12`, `m21`, `m22`, `tx`, and `ty`.
Since Gideros 2016.6, Matrix can also hold 3D (4x4) matrices.
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
MethodsMatrix.new - creates a new Matrix object  | 
EventsConstants |