Creates a new Transform object.
Restores the transformation matrix to the identity matrix.
void CustomTransform(
array
$trans
)
|
|
Adds a custom transformation.
Parameters:
|
array |
$trans: |
A 3x3 transformation matrix to include. |
void Rotate(
number
$theta
)
|
|
Adds a rotation operation.
Parameters:
|
number |
$theta: |
The angle of rotation. |
void Scale(
[number
$x = 1], [number
$y = 1]
)
|
|
Adds a scaling operation.
Parameters:
|
number |
$x: |
The value to scale in along the X axis. |
|
number |
$y: |
The value to scale in along the Y axis. |
void Sheer(
[number
$x = 0], [number
$y = 0]
)
|
|
Adds a sheering operation.
Parameters:
|
number |
$x: |
The sheering value along the X axis. |
|
number |
$y: |
The sheering value along the Y axis. |
Performs the stored transformation on $poly. $cx = $y = -1 will set the centre of the Polygon as origin.
Parameters:
|
Polygon |
$poly: |
The Polygon to transform. |
|
int |
$cx: |
The X co-ordinate to act as origin. |
|
int |
$cy: |
The Y co-ordinate to act as origin. |
void Translate(
number
$x, number
$y
)
|
|
Adds a translation operation.
Parameters:
|
number |
$x: |
Translation along X axis. |
|
number |
$y: |
Translation along Y axis. |