How to close a curvy Perlin blob nicely?
in
Programming Questions
•
2 years ago
I am so happy to have finally undertaken programming again, all thanks to the helpful processing language, community and books. Thank you. I accidentaly made my first game, and now I want to try to do the ecosystem practice task in Shiffmans book.
So this is my first problem I have not been able to solve myself. How to close this in a curvy way?
- float[] tid = new float[12];
- float angle;
- void setup() {
- size(800, 800);
- for (int i=0;i<11;i++) {
- tid[i] = random(0, 1);
- }
- colorMode(HSB);
- noStroke();
- angle = 360 / 8;
- }
- void draw() {
- background(255);
- fill(int(noise(tid[1])*360), 255, 200);
- beginShape();
- for (int i=1;i<12;i++) {
- curveVertex(width/3 + 200 * cos(radians(angle*i))+noise(tid[i])*300, height/3 + 200 * sin(radians(angle*i))+noise(tid[i-1])*300);
- }
- endShape(CLOSE);
- for (int i=0;i<11;i++) {
- tid[i] += random(0, 0.01);
- }
- }
2