arc

hi,
wanna draw a half circle (or an arc) on the iPhone. according to http://forum.openframeworks.cc/t/crosspost:ofxmsaphysicsshape3d—compatible-with-opengl-es/3799/6 it’s not possible to use glBegin, therefore ofxVectorGraphics addon won’t work and all examples i could find on the net use a similiar technique.

so, how to draw an arc without glBegin?
thanks!

try using ofBeginShape(), ofVertex(), and ofEndShape()

thanks, should have looked at the docs…

this is my code to draw half a circle on iOS in case anyone else looking for the same solution:

  
                   
ofBeginShape();     
for(int i = 0; i < resolution; i++) {   
 angle = i*M_PI/resolution;   
 ofVertex(x + (cos(angle) * radius), y + (sin(angle) * radius));  
}   
ofEndShape();