quadraticVertex

(別名: quadratic_vertex)

def setup
  background(220)
  strokeWeight(5)
  point(20, 20)
  point(80, 20)
  point(50, 50)

  noFill
  strokeWeight(1)
  beginShape
  vertex(20, 20)
  quadraticVertex(80, 20, 50, 50)
  endShape
end
def setup
  background(220)
  strokeWeight(5)
  point(20, 20)
  point(80, 20)
  point(50, 50)

  point(20, 80)
  point(80, 80)
  point(80, 60)

  noFill
  strokeWeight(1)
  beginShape
  vertex(20, 20)
  quadraticVertex(80, 20, 50, 50)
  quadraticVertex(20, 80, 80, 80)
  vertex(80, 60)
  endShape
end

p5.jsリファレンス(参考情報)

[p5.js] quadraticVertex

概要

二次ベジェ曲線の頂点座標を指定します。

書式

quadraticVertex(cx, cy, x3, y3)
quadraticVertex(cx, cy, cz, x3, y3, z3)

引数

引数名内容備考オプションデフォルト値
cx制御点の x座標
cy制御点の y座標
x3基準点の x座標アンカーポイント
y3基準点の y座標アンカーポイント
cz制御点の z座標WEBGLモードのキャンバスでのみ有効
z3基準点の z座標WEBGLモードのキャンバスでのみ有効

戻値

なし

備考

・「beginShapeendShape」構文または「shape do ~ end」構文の中でのみ有効です。

関連

beginShape
endShape
shape