2017年4月2日日曜日

openframeworks ofVboMesh で塗りつぶした円

mesh.clear();
mesh.setMode(OF_PRIMITIVE_TRIANGLE_FAN);

constexpr float ciclr = (PI * 2) / 6;

ofVec3f pos = { 300.f, 300.f,0.f };

for (int i = 0; i < 7; i++) {

mesh.addColor(ofColor(200, 255));
mesh.addVertex({ pos.x + cos(ciclr * i) * 100, pos.y + sin(ciclr * i) * 100, 0.f });

}

mesh.draw();

http://okasuke.hatenablog.com/entry/2014/01/12/224943