rotateZ()

本参考资料用于Processing 3.0+。 如果你使用的是前一版本,请在使用软件帮助菜单内的参考资料。. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

名称

rotateZ()

示例
 size(100, 100, P3D);

translate(width/2, height/2);

rotateZ(PI/3.0);

rect(-26, -26, 52, 52);

 size(100, 100, P3D);

translate(width/2, height/2);

rotateZ(radians(60));

rect(-26, -26, 52, 52);

描述 Rotates around the z-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to TWO_PI) or converted from degrees to radians with the radians() function. Coordinates are always rotated around their relative position to the origin. Positive numbers rotate in a clockwise direction and negative numbers rotate in a counterclockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect. For example, calling rotateZ(PI/2) and then rotateZ(PI/2) is the same as rotateZ(PI). If rotateZ() is run within the draw(), the transformation is reset when the loop begins again. This function requires using P3D as a third parameter to size() as shown in the example above.
语法
rotateZ(angle)
参数
angle float: angle of rotation specified in radians
返回值 void
相关 popMatrix()
pushMatrix()
rotate()
rotateX()
rotateY()
scale()
translate()

Updated on October 2, 2018 05:02:09pm EDT

rotateZ()