iasksillyquestions
iasksillyquestions

Reputation: 5689

Drawing a circle in openGL for android

So I'd like to be able to draw a circle where I can specify the amount of circle drawn as shown in the following diagram.

example

AS an opengl newbie I'm not really sure how to approach this.. I've previously drawn full circles using GL_TRIANGLE_FAN

Upvotes: 0

Views: 1025

Answers (2)

datenwolf
datenwolf

Reputation: 162164

You already know how to draw a circle using a triangle fan. Now you just have to calculate the angles of the cutoff corners, use those as the beginning and end of the arc and place the hub of the triangle fan at the middle of the cutoff edge.

Upvotes: 2

P.Melch
P.Melch

Reputation: 8180

you could use a glScissor test to cut off the parts of the circle that you don't want. http://www.khronos.org/opengles/sdk/1.1/docs/man/glScissor.xml

Upvotes: 0

Related Questions