I'm experimenting with a widget that uses DrawWorld to draw circles.
Does anyone know how the following could be done:
Essentially the overlapped parts are removed.
It would be awesome if someone knows how to do this.
OpenGL, overlapping circles
Moderator: Moderators
Re: OpenGL, overlapping circles
Use the brute way! Calculate which circles intersect, and where, then draw only the segment that are outside the intersecting slice. Since it only involves circles in a 2D plane, the calculation involved are not that complicated.
Re: OpenGL, overlapping circles
Thats all very well, but I am a OpenGL noob.
How do I draw only a part circle. So far I have used gl.DrawGroundCircle
How do I draw only a part circle. So far I have used gl.DrawGroundCircle
Re: OpenGL, overlapping circles
A bit like that (not tested):
Code: Select all
local function YourVertFunction()
for angle=0,2*math.pi*3/4,math.pi/32 do
gl.Vertex(x+r*math.cos(a),y,z+r*math.sin(a))
end
end
gl.BeginEnd(GL.LINE_LOOP,YourVertFunction)
Re: OpenGL, overlapping circles
The UnitShapes widget uses OpenGL tricks to do seamlessly-merged circles/shapes.