-
Notifications
You must be signed in to change notification settings - Fork 26
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
Circle.segments not recalculated when change radius #39
Comments
Yes, I hesitated about exposing There is a workaround that works now: construct a large circle first, scale it down, then animate it scaling back to 1. |
Yes I used the workaround of starting big and scaling down on the next line, before its drawn. For a basic, tactical, fix maybe On the other hand, if in future multi-segment line allows changing the segments, then a circle could 'just work' by using that OpenGL segment rebuild logic. |
It is relatively easy to implement, as vertex lists can already be resized. But it's expensive. I think my original thinking was to expose segments in the constructor and make it updatable as an attribute. Only if you don't set it does it calculate an initial value. |
Just to throw in a random idea. Circles can be generated on the fly with geo shader fairly efficiently: https://github.com/pvcraven/arcade/tree/shader_experimental/arcade/resources/shaders/shapes/ellipse Still there might be hardware out there being limited to 256 emitted vertices, but most have 4096. Limited the segments to 85 in this version, but that could be 340 if separated in 4 quadrants. It could be used to draw the circle on the fly or generate a buffer we draw later. |
I found this doing a quick porting of Tron demo from PyGameZero to entice my son to try making his own games.
When I animated the explosion circle it was a pentagon.
FYI:
Demo of problem:
The text was updated successfully, but these errors were encountered: