Processing, beginContour()
用法介紹。
用法
beginContour()
返回
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 beginCamera()用法及代碼示例
- Processing beginShape()用法及代碼示例
- Processing beginRaw()用法及代碼示例
- Processing beginRecord()用法及代碼示例
- Processing bezierPoint()用法及代碼示例
- Processing bezierDetail()用法及代碼示例
- Processing bezierVertex()用法及代碼示例
- Processing bezierTangent()用法及代碼示例
- Processing bezier()用法及代碼示例
- Processing box()用法及代碼示例
- Processing binary()用法及代碼示例
- Processing blendMode()用法及代碼示例
- Processing boolean()用法及代碼示例
- Processing break用法及代碼示例
- Processing boolean用法及代碼示例
- Processing background()用法及代碼示例
- Processing brightness()用法及代碼示例
- Processing blue()用法及代碼示例
- Processing byte()用法及代碼示例
- Processing blend()用法及代碼示例
- Processing byte用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 beginContour()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。