Reference rotateX()

rotateX()

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

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

By default, transformations accumulate. For example, calling rotateX(1) twice has the same effect as calling rotateX(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 rotateX(1) inside the draw() function won't cause shapes to spin.

Examples

Syntax

rotateX(angle)

Parameters

angle
Number:

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