Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there no circle or ellipse primitive in OpenGL?

Tags:

opengl

Circles are one of the basics geometric entities. Yet there is no primitives defined in OpenGL for this, like lines or polygons. Why so? It's a little annoying to include custom headers for this all the time!

Any specific reason to omit it?

like image 981
Laz Avatar asked May 30 '10 14:05

Laz


People also ask

What are the graphics primitives in OpenGL?

In OpenGL, an object is made up of geometric primitives such as triangle, quad, line segment and point. A primitive is made up of one or more vertices. OpenGL supports the following primitives: A geometric primitive is defined by specifying its vertices via glVertex function, enclosed within a pair glBegin and glEnd .


1 Answers

While circles may be basic shapes they aren't as basic as points, lines or triangles when it comes to rasterisation. The first graphic cards with 3D acceleration were designed to do one thing very well, rasterise triangles (and lines and points because they were trivial to add). Adding any more complex shapes would have made the card a lot more expensive while adding only little functionality.

But there's another reason for not including circles/ellipses. They don't connect. You can't build a 3D model out of them and you can't connect triangles to them without adding gaps or overlapping parts. So for circles to be useful you also need other shapes like curves and other more advanced surfaces (e.g. NURBS). Circles alone are only useful as "big points" which can also be done with a quad and a circle shaped texture, or triangles.

If you are using "custom headers" for circles you should be aware that those probably create a triangle model that form your "circles".

like image 136
Maurice Gilden Avatar answered Nov 15 '22 13:11

Maurice Gilden