Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draw a smooth expanding circle

Tags:

c#

xna

I want to create a sonar ping, where when it is activated a circle emanates from a ship's position. However, if I use a texture and scale it up as the circle gets bigger, the thickness of the circle increases as well, and I've tried to use a spritesheet but the size of the sheet needed to make the expansion look smooth is impractical. How would I go about programming a smooth expanding circle?

like image 772
Cogythea Avatar asked Feb 09 '14 23:02

Cogythea


1 Answers

Depending on how complicated the shape that you're trying to produce is, you might be able to do it entirely in a pixel shader. See this article for an example of how to draw very simple anti-aliased circles in this way.

like image 170
Cole Campbell Avatar answered Oct 01 '22 06:10

Cole Campbell