Get rid of moire/Moray pattern
in
Programming Questions
•
1 year ago
Hi... I'm trying to implement a pie chart taken from Ira's example (Examples/Basic/Form/PieChart)
And I'm getting persistent Moray effects, which I don't want.
At first I was passing an array that was greater than 360 units in length, but now I'm only passing the first 360...
but it's still persisting.
Anyone have any ideas on how to get rid of this?
Here's the code...
- int diameter = 3*(height/4); // set the diameter
- int[] angs = new int[edits.length]; // create new int array
- for(int i = 0; i < 360; i++) {
- angs[i] = int(edits[i]); // cast a string array as ints and populate matching int array
- }
- float lastAng = 0;
- stroke(255);
- for (int i = 0; i < 360; i++){
- fill(map(angs[i], 0, 16, 0, 255));
- arc(width/2, height/2, diameter, diameter, lastAng, lastAng+radians(angs[i])); // draw arc
- lastAng += radians(angs[i]); // start at new angle
- }
1