Processing, endContour()用法介紹。
用法
endContour()
返回
void
說明
使用beginContour() 和endContour() 函數在形狀內創建負形狀,例如字母'O' 的中心。 beginContour() 開始記錄形狀的頂點,endContour() 停止記錄。定義負形狀的頂點必須在與外部形狀相反的方向上"wind"。首先按順時針順序為外部形狀繪製頂點,然後為內部形狀逆時針繪製頂點。
這些函數隻能在 beginShape() /endShape() 對中使用,並且 translate() 、 rotate() 和 scale() 等轉換在 beginContour() /endContour() 對中不起作用。也不能在其中使用其他形狀,例如ellipse() 或rect()。
例子
size(400, 400);
translate(200, 200);
stroke(255, 0, 0);
beginShape();
// Exterior part of shape, clockwise winding
vertex(-160, -160);
vertex(160, -160);
vertex(160, 160);
vertex(-160, 160);
// Interior part of shape, counter-clockwise winding
beginContour();
vertex(-80, -80);
vertex(-80, 80);
vertex(80, 80);
vertex(80, -80);
endContour();
endShape(CLOSE);
相關用法
- Processing endCamera()用法及代碼示例
- Processing endRaw()用法及代碼示例
- Processing endShape()用法及代碼示例
- Processing endRecord()用法及代碼示例
- Processing exp()用法及代碼示例
- Processing emissive()用法及代碼示例
- Processing else用法及代碼示例
- Processing ellipseMode()用法及代碼示例
- Processing extends用法及代碼示例
- Processing expand()用法及代碼示例
- Processing ellipse()用法及代碼示例
- Processing exit()用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
- Processing join()用法及代碼示例
- Processing () (parentheses)用法及代碼示例
- Processing Pulse用法及代碼示例
- Processing PShader用法及代碼示例
- Processing PVector.set()用法及代碼示例
- Processing FloatDict.sortKeysReverse()用法及代碼示例
- Processing texture()用法及代碼示例
- Processing IntDict.add()用法及代碼示例
- Processing PShape.enableStyle()用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 endContour()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
