This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
IMPORTANT INFO: | |
This code is made to be renderer-agnostic. | |
You would complete the implementation by implementing the triangle() function for your particular renderer. | |
The code is not written to make use of an index buffer, so it is not perfectly efficient in terms of memory usage. | |
You can replace the vector / matrix math with types from your own math library if you want, or leave it as-is. | |
This implementation assumes coordinates are in screen pixel space (circleDetail() relies on that fact). | |
If you want to draw partially transparent lines, you will need render all triangles of a line at the same depth | |
and use the less-than or greater-than or not-equal depth test (e.g. glDepthFunc(GL_LESS) or GL_GREATER or GL_NOTEQUAL) | |
because some triangles overlap. |