Processing, rotate()用法介紹。
用法
rotate(angle)
參數
angle(float)以弧度指定的旋轉角度
返回
void
說明
將形狀旋轉 angle 參數指定的量。角度應以弧度指定(值從 0 到 TWO_PI)或使用 radians() 函數轉換為弧度。
對象始終圍繞其相對於原點的位置旋轉,正數以順時針方向旋轉對象。轉換適用於之後發生的所有事情,隨後對函數的調用會累積效果。例如,調用 rotate(HALF_PI) 然後 rotate(HALF_PI) 與 rotate(PI) 相同。當 draw() 再次開始時,所有轉換都會重置。
從技術上講,rotate() 將當前變換矩陣乘以旋轉矩陣。此函數可以通過 pushMatrix() 和 popMatrix() 進一步控製。
例子
size(400, 400)
translate(width/2, height/2);
rotate(PI/3.0);
rect(-104, -104, 208, 208);
相關用法
- Processing rotateX()用法及代碼示例
- Processing rotateZ()用法及代碼示例
- Processing rotateY()用法及代碼示例
- Processing round()用法及代碼示例
- Processing rect()用法及代碼示例
- Processing randomGaussian()用法及代碼示例
- Processing resetMatrix()用法及代碼示例
- Processing rectMode()用法及代碼示例
- Processing redraw()用法及代碼示例
- Processing reverse()用法及代碼示例
- Processing red()用法及代碼示例
- Processing requestImage()用法及代碼示例
- Processing return用法及代碼示例
- Processing radians()用法及代碼示例
- Processing random()用法及代碼示例
- Processing resetShader()用法及代碼示例
- Processing randomSeed()用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
- Processing join()用法及代碼示例
- Processing () (parentheses)用法及代碼示例
- Processing Pulse用法及代碼示例
- Processing PShader用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 rotate()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
