在 WebGL 模式下,围绕 x 轴旋转坐标系。
参数 angle 是旋转的角度。例如,调用 rotateX(1) 会使坐标系围绕 x 轴旋转 1 弧度。rotateX() 根据当前的 angleMode() 解释角度值。
默认情况下,转换会累积。例如,连续调用两次 rotateX(1) 与调用一次 rotateX(2) 效果相同。可以使用 push() 和 pop() 函数将转换隔离到不同的绘图组中。
注意:转换会在绘制循环的开始处重置。在 draw() 函数中调用 rotateX(1) 不会导致形状旋转。
示例
语法
rotateX(angle)
参数
angle
数字:
当前 angleMode() 中的旋转角度。
This page is generated from the comments in src/core/transform.js . Please feel free to edit it and submit a pull request!