Discuss Scratch

sly_i
Scratcher
13 posts

Pen Ellipse Animation

Hi All,
I playing around with pen ellipse animation but im getting very poor performance vs clone animation.
Any suggestions on how to improve pen animations speed?

Clone sample: https://scratch.mit.edu/projects/795723574/
Pen sample: https://scratch.mit.edu/projects/796299161/

Thanks
slyi
Spentine
Scratcher
1000+ posts

Pen Ellipse Animation

The way to improve the pen animation's speed is to not use bresenham's algorithm, and instead use sin() and cos() each scaled by a factor.
sly_i
Scratcher
13 posts

Pen Ellipse Animation

Spentine wrote:

The way to improve the pen animation's speed is to not use bresenham's algorithm, and instead use sin() and cos() each scaled by a factor.
Thanks Spentine. I never knew, there was so much variety of methods for ellipse drawing then i found https://scratch.mit.edu/studios/29609673/
Using your suggestion I tried a few scaled sin and cos with much improved performance
1. Uses GoTo XY https://scratch.mit.edu/projects/796804017/
2. Uses Move and Direction https://scratch.mit.edu/projects/796612453/

Powered by DjangoBB