Hey guys, my bgl point comes out looking like a square. Is there any way I can make a circle out of this via smoothing or whatever?
I know I can use def draw circle 2d to create my own circle and then just place it where i want, but I don’t know how to make a filled solid circle… So honestly just having the point drawn as a circle would be the simplest way. Either way is fine
If you can define a circle in coordinates, you can fill it using the TRI_FAN method where every triangle of a shape share a common vertex. This gives the best prospects for anti-aliasing the shape later.
from math import pi, cos, sin
def circle(x, y, radius, segments):
coords = []
m = (1.0 / (segments - 1)) * (pi * 2)
for p in range(segments):
p1 = x + cos(m * p) * radius
p2 = y + sin(m * p) * radius
coords.append((p1, p2))
return coords
just do it with a pixel shader… adding extra triangles to make a 2D circle when you have access to shaders is a bad idea to begin with. https://thebookofshaders.com/07/