Static p5_sys::global::rotateZ [−][src]
pub static rotateZ: RotateZInternalType
Expand description
Rotates a shape around Z axis by the amount specified in angle parameter. The angles can be entered in either RADIANS or DEGREES.
This method works in WEBGL mode only.
Objects are always rotated around their relative position to the origin and positive numbers rotate objects in a clockwise direction. All tranformations are reset when draw() begins again.
Examples
function setup() { createCanvas(100, 100, WEBGL); } function draw() { background(255); rotateZ(millis() / 1000); box(); }
Parameters
angle
the angle of rotation, specified in radians
or degrees, depending on current angleMode