Circle with Triangle strips

3d, c++, opengl

Solution

One way to specify a circle with a triangle strip is as follows:

for each step
    add next position on circle
    add circle center

This will include the circle's center position. Another way without including the center is this:

add left most vertex
for each phi in (-PI/2, Pi/2) //ommit the first and last one
    x = r * sin(phi)
    y = r * cos(phi)
    add (x, y)
    add (x, -y)
add right most vertex

You may need to adjust the loops depending on your backface culling settings

The topologies require different numbers of vertices. For a triangle list 10 circles á 1000 triangles need 30,000 vertices. With a triangle strip you need 1002 vertices per circle, so overall 10,020 vertices. This is almost three times smaller, which should be a bit faster when transferring to the CPU. If this is reflected in the FPS depends on several things.

Problem

I have been trying to create a circle in OpenGL but I cannot use triangle fans because I have read they are not available in directx anymore and I will also be making directx calls. I could not really understand how triangle strips work. All my implementations had holes or weird quirks, can anybody help me out here, how can I implement it in the best possible way? Also is there really any performance difference between triangle strips and seperate triangles, for lets say 10 circles with 1000 triangles each. Will it make a lot of difference?

Original source