Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL—ES 1.0 2d rounded rectangle

Tags:

People also ask

How do you draw a rounded rectangle in opengl?

Using polygons Calculating corner coordinates is easy. Just find a point from circle and build triangles like in picture above. float anglerad = PI * angle / 180.0f; float x = sinf(anglerad) * radius; float y = cosf(anglerad) * radius; It will still have sharp edges, but more points make corners more round.


How to make rounded rectangle in OpenGL, or any polygon with rounded corners?