Schmavery / reprocessing

ReasonML graphics library inspired by Processing
https://schmavery.github.io/reprocessing/
MIT License
682 stars 24 forks source link

The arc implementation is janky #52

Closed jaredly closed 6 years ago

jaredly commented 6 years ago
image

^ in the middle is supposed to be 4 even quarters of a pie, w/ no space between them. Also the pink ring is done w/ ellipse -- there's not supposed to be a gap.

image

and this is supposed to be two halves of a pie.

image

also see the overlap ^ where the dot on the right is brighter. This is an ellipse that's semitransparent.

cc @bsansouci

Schmavery commented 6 years ago

Mhh, seems like it might be an off-by-one issue. Can you post the code snippets so that I can make sure I understand what's happening? Not surprised there are a couple artifacts with alpha, that was added after most of the other code. Will try to clean it up.

jaredly commented 6 years ago

It's not an off-by-one, it's the fact that the arcs have a limit on the granularity that they render. It's because we're doing like a 30-sided polygon, and if the length of the arc wants to be 29.5 of those sides, we only render 29 sides.

jaredly commented 6 years ago

Here's an example of animating an arc, and you can see how jerky it is https://schmavery.github.io/reprocessing/?gist=69fb9c2733776faab624d45046c1bfa7

Schmavery commented 6 years ago

Right, I was hoping it wouldn't be that haha. Thanks for double checking. Might need some fancy logic to handle the ends of the arc properly.

jaredly commented 6 years ago

although actually maybe there is an off-by-one in there too, see https://schmavery.github.io/reprocessing/?gist=3e929c7dc5392e2cbc8d17aa1cff4f3d

Schmavery commented 6 years ago

This is a good reminder for me to fix the gist capability in the web env.. Thanks for the examples!

Schmavery commented 6 years ago

Hopefully 54be1fc4dd4d9a8a5753d765b8b4124ab8dcf45b fixes this?

Schmavery commented 6 years ago

Will close these arc issues. Please lmk if they don't help and we can reopen them. Thanks!