def setup
background(220)
noFill
beginShape
vertex(30, 20)
bezierVertex(80, 0, 80, 75, 30, 75)
endShape
end
def setup
background(220)
beginShape
vertex(30, 20)
bezierVertex(80, 0, 80, 75, 30, 75)
bezierVertex(50, 80, 60, 25, 30, 20)
endShape
end
def setup
createCanvas(100, 100, WEBGL)
end
def draw
orbitControl
background(50)
strokeWeight(4)
stroke(255)
point(-25, 30)
point(25, 30)
point(25, -30)
point(-25, -30)
strokeWeight(1)
noFill
beginShape
vertex(-25, 30)
bezierVertex(25, 30, 25, -30, -25, -30)
endShape
beginShape
vertex(-25, 30, 20)
bezierVertex(25, 30, 20, 25, -30, 20, -25, -30, 20)
endShape
end
ベジェ曲線の頂点座標を指定します。
| 引数名 | 内容 | 備考 | オプション | デフォルト値 |
|---|---|---|---|---|
| x2 | 制御点1の x座標 | |||
| y2 | 制御点1の y座標 | |||
| x2 | 制御点2の x座標 | |||
| y2 | 制御点2の y座標 | |||
| x4 | 基準点の x座標 | アンカーポイント | ||
| y4 | 基準点の y座標 | アンカーポイント | ||
| z2 | 制御点1の z座標 | WEBGLモードのキャンバスでのみ有効 | ||
| z3 | 制御点2の z座標 | WEBGLモードのキャンバスでのみ有効 | ||
| z4 | 基準点2の z座標 | WEBGLモードのキャンバスでのみ有効 |
なし
・「beginShape ~ endShape」構文または「shape do ~ end」構文の中でのみ有効です。