Why is there no circle or ellipse primitive in OpenGL?

前端 未结 5 2244
执念已碎
执念已碎 2021-02-12 16:50

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 custo

5条回答
  •  北海茫月
    2021-02-12 17:11

    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".

提交回复
热议问题