Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to draw a filled circle #27

Open
ldicker83 opened this issue Apr 8, 2017 · 5 comments
Open

Add function to draw a filled circle #27

ldicker83 opened this issue Apr 8, 2017 · 5 comments
Labels
Milestone

Comments

@ldicker83
Copy link
Member

NAS2D provides basic circle filling. Would like to extend this to include filled circles.

@ldicker83 ldicker83 added the task label Apr 8, 2017
@ldicker83 ldicker83 added this to the v1.4.0 milestone Apr 8, 2017
@ldicker83 ldicker83 modified the milestones: v1.4.0, v1.5.0 May 15, 2017
@ldicker83 ldicker83 modified the milestones: v1.5.0, 1.6.0 May 19, 2019
@DanRStevens
Copy link
Collaborator

Is this something we really need? There doesn't seem to be any pressing need for it. I mean, it's been open for almost 7 years with no progress, so it can't be all that important.

Only place I can think of that had circular elements, were the planets in OPHD, and that was handled with sprites.

Also, the initial description is a bit confusing. It mentions providing basic circle filling, and extending that to include filled circles. Do we even have the initial functionality listed? There is a drawCircle function, though that's really more about drawing a regular polygon rather than a circle. At best it can approximate a circle by using a large number of sides. It's not really super clear what this issue is really about.

If we're going to keep this open, maybe we need to specify the goal a little more clearly. Failing that, perhaps we should just close this as something we won't implement.

@cugone
Copy link
Contributor

cugone commented Jan 18, 2024

I thought I'd implemented this, re: comments mentioned #427 issue but for the life of me I can't find the code locally. It may have been purged since I built a new computer since then. Not a big deal to re-implement it if you want.

@ldicker83
Copy link
Member Author

I would welcome the contribution!

@DanRStevens
Copy link
Collaborator

Helpful that we have a test project now to examine things visually.

Curious if the implementation was something fast like Bresenham's circle drawing algorithm, or something slow based on trig functions.

I suppose that shouldn't matter too much if there is currently no implementation.

@cugone
Copy link
Contributor

cugone commented Jan 21, 2024

Bresenham's algorithm is for rasterization, the GPU does this automatically. Since it's a circle, and as a first step of "get it working first" I'd use a triangle fan and matrix transform to scale/translate it. A second "more efficient" version can be done on the GPU but it's complex to get working.

That said, the base nas2d-core project doesn't even compile. See #1149.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants