Difference between revisions of "Matrix.fromSRT"

From GiderosMobile
(Created page with "'''Available since:''' Gideros 2021.11<br/> '''Class:''' Matrix<br/> === Description === Builds a matrix from scale/rotation/translation components. The scale/rotate/tran...")
 
m
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Builds a matrix from scale/rotation/translation components.
 
Builds a matrix from scale/rotation/translation components.
The scale/rotate/translate specification is given by a table, which can have the following fields:
 
* '''s''' or '''scale''': The matrix scale component
 
* '''r''' or '''rotation''': The matrix rotation component (a quaternion)
 
* '''t''' or '''translate''' or '''position''': The matrix translation component
 
 
 
<source lang="lua">
 
<source lang="lua">
 
(matrix) = Matrix.fromSRT(srt,reverse)
 
(matrix) = Matrix.fromSRT(srt,reverse)
 
</source>
 
</source>
 +
The scale/rotate/translate specification is given by a table, which can have the following fields:
 +
* '''s''' or '''scale''': the matrix scale component
 +
* '''r''' or '''rotation''': the matrix rotation component (a quaternion)
 +
* '''t''' or '''translate''' or '''position''': the matrix translation component
  
 
=== Parameters ===
 
=== Parameters ===
'''srt''': (table) Scale, rotate, translate specification
+
'''srt''': (table) scale, rotate, translate specification</br>
'''reverse''': (boolean) Build a matrix where component application is reverted
+
'''reverse''': (boolean) build a matrix where component application is reverted</br>
  
 
=== Return values ===
 
=== Return values ===
'''Returns''' (matrix) The matrix object
+
'''Returns''' (matrix) the matrix object
  
 
{{Matrix}}
 
{{Matrix}}

Revision as of 12:37, 16 March 2022

Available since: Gideros 2021.11
Class: Matrix

Description

Builds a matrix from scale/rotation/translation components.

(matrix) = Matrix.fromSRT(srt,reverse)

The scale/rotate/translate specification is given by a table, which can have the following fields:

  • s or scale: the matrix scale component
  • r or rotation: the matrix rotation component (a quaternion)
  • t or translate or position: the matrix translation component

Parameters

srt: (table) scale, rotate, translate specification
reverse: (boolean) build a matrix where component application is reverted

Return values

Returns (matrix) the matrix object