def setup
background(220)
beginShape
vertex(30, 20)
vertex(85, 20)
vertex(85, 75)
vertex(30, 75)
endShape(CLOSE)
end
def setup
background(220)
beginShape(POINTS)
vertex(30, 20)
vertex(85, 20)
vertex(85, 75)
vertex(30, 75)
endShape
end
def setup
background(220)
beginShape(LINES)
vertex(30, 20)
vertex(85, 20)
vertex(85, 75)
vertex(30, 75)
endShape
end
def setup
background(220)
noFill
beginShape
vertex(30, 20)
vertex(85, 20)
vertex(85, 75)
vertex(30, 75)
endShape
end
def setup
background(220)
noFill
beginShape
vertex(30, 20)
vertex(85, 20)
vertex(85, 75)
vertex(30, 75)
endShape(CLOSE)
end
def setup
background(220)
beginShape(TRIANGLES)
vertex(30, 75)
vertex(40, 20)
vertex(50, 75)
vertex(60, 20)
vertex(70, 75)
vertex(80, 20)
endShape
end
def setup
background(220)
beginShape(TRIANGLE_STRIP)
vertex(30, 75)
vertex(40, 20)
vertex(50, 75)
vertex(60, 20)
vertex(70, 75)
vertex(80, 20)
vertex(90, 75)
endShape
end
def setup
background(220)
beginShape(TRIANGLE_FAN)
vertex(57.5, 50)
vertex(57.5, 15)
vertex(92, 50)
vertex(57.5, 85)
vertex(22, 50)
vertex(57.5, 15)
endShape
end
def setup
background(220)
beginShape(QUADS)
vertex(30, 20)
vertex(30, 75)
vertex(50, 75)
vertex(50, 20)
vertex(65, 20)
vertex(65, 75)
vertex(85, 75)
vertex(85, 20)
endShape
end
def setup
background(220)
beginShape(QUAD_STRIP)
vertex(30, 20)
vertex(30, 75)
vertex(50, 20)
vertex(50, 75)
vertex(65, 20)
vertex(65, 75)
vertex(85, 20)
vertex(85, 75)
endShape
end
def setup
background(220)
beginShape(TESS)
vertex(20, 20)
vertex(80, 20)
vertex(80, 40)
vertex(40, 40)
vertex(40, 60)
vertex(80, 60)
vertex(80, 80)
vertex(20, 80)
endShape(CLOSE)
end
指定された頂点座標を記録して図形を描画します。
| 引数名 | 内容 | 備考 | オプション | デフォルト値 |
|---|---|---|---|---|
| kind | 種別 | POINTS LINES TRIANGLES TRIANGLE_FAN TRIANGLE_STRIP QUADS QUAD_STRIP TESS | ○ |
なし
・必ず endShapeメソッドとペアで使用してください。
・「beginShape ~ endShape」を Rubyライクな構文にした「shape do ~ end」も同じ動作をします。