HTML5 Canvas 2D Library
 

TM Property of taccgl

Short Description: Transformation Matrix

Signature:   taccgl.TM
 

TM holds a 4x4 transformation matrix using homogenous coordinates that can be used to translate the position of transitions selected with useTM.

Initially TM holds the identity matrix. It can be read or written anytime and should be written with the setTM or setTMorth method. Changing TM however only has an effect on transitions that explicitly use useTM. On the other hand the transformation matrix is applied simultanously on all transitions that use useTM. There is just one global transformation matrix for all these transitions. Changing TM is much faster than changing each transition individually, so TM is usually used to animate all or at least many objects/transitions of a scene.

setTM Library Method

Short Description: Set Transformation Matrix

Signature: taccgl.setTM (tm)
Class: taccgl Class
 

sets the transformation matrix to the specified argument tm and also adapts TM_1.

In the following example the id=para element is moved using the TM while at the same time the id=testimg stays unaffected, since useTM is applied to the id=para only. In the second example below, both elements are affected.

Examples

var a=taccgl.actor("testimg").to (0,1000,0).start();
var b=taccgl.actor("para").useTM().start();
taccgl.setTM(taccgl.m44Translation(200,100,0)); taccgl.start();
RUN
var a=taccgl.actor("testimg").to (0,1000,0).useTM().start();
var b=taccgl.actor("para").useTM().start();
taccgl.setTM(taccgl.m44Translation(200,100,0)); taccgl.start();
RUN

TM_1 Property of taccgl

Short Description: Inverse Transformation Matrix

Signature:   taccgl.TM
 
TM_1 holds the inverse of the top left 3x3 submatrix of the transformation matrix. It should always be set with the setTM or setTMorth method.

setTMorth Library Method

Short Description: Set orthogonal Transformation Matrix

Signature: taccgl.setTMorth (tm)
Class: taccgl Class
 
Works like setTM and sets the TM and TM_1 properties, but may only be used for an orthogonal matrix tm. This functions is slightly faster, because it avoids calculating the inverse matrix.
Next Page:taccgl.Matrix - Matrix Operations
Previous Page: taccgl.setTMorth - Set orthogonal Transformation Matrix