Reference rotateZ()

rotateZ()

Rotates the coordinate system about the z-axis in WebGL mode.

The parameter, angle, is the amount to rotate. For example, calling rotateZ(1) rotates the coordinate system about the z-axis by 1 radian. rotateZ() interprets angle values using the current angleMode().

By default, transformations accumulate. For example, calling rotateZ(1) twice has the same effect as calling rotateZ(2) once. The push() and pop() functions can be used to isolate transformations within distinct drawing groups.

Note: Transformations are reset at the beginning of the draw loop. Calling rotateZ(1) inside the draw() function won't cause shapes to spin.

Examples

Syntax

rotateZ(angle)

Parameters

angle

angle of rotation in the current angleMode().

Notice any errors or typos? Please let us know. Please feel free to edit src/core/transform.js and open a pull request!

Related References