We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,there. I am trying to create a wobbly shape which is similar the pic I attached below.
And here is what I have so far.
The thing is this shape doesn't change that smoothly as I expected.Especially the connection part,I just joined the last vertex to the first vertex,so a short straight ling always appears there.Guess I should fix it by giving this two vertexes same arguments,but I don't know how. Basically,What I want is a shape looks like generated by several bezier curves,so hope you guys can help me to improve it.
Otherwise,I applied blurry filter to the shape, but the filter runs crazy slowly. I tried to find a solution at this forum,someone says I'd better use a GPU based shader , and also I found a fast blurring , but I am a really beginner,its too complicated for me to apply it. I would be very grateful if someone can help me with it.
PS: I am planning apply minim beats detector in my next step, so all suggestions about this are very welcome.
float xoff=0;
float yoff=0;
float xoff2=0;
float yoff2=0;
float xoff3=0;
float yoff3=0;
void setup() {
size(800, 800);
smooth();
frameRate(20);
}
void draw() {
background(245,250,255);
pushMatrix();
translate(width/2, height/2);
strokeWeight(83);
stroke(255,0,240,130);
noFill();
beginShape();
float c=0;
while(c<=TWO_PI){
c+=0.4;
float offset=map(noise(xoff3,yoff3), 1, 2, -22, 32);
float Radius=height/4+offset;
float x3=Radius*cos(c);
float y3=Radius*sin(c);
vertex(x3, y3);
xoff3+=0.1;
yoff3+=0.1;
}
endShape(CLOSE);
strokeWeight(80);
stroke(20,200,200,150);
noFill();
beginShape();
float b=0;
while(b<=TWO_PI){
b+=0.3;
float offset=map(noise(xoff2,yoff2), 1, 2, -25, 25);
float Radius=height/4+offset+4;
float x2=Radius*cos(b);
float y2=Radius*sin(b);
vertex(x2, y2);
xoff2+=0.1;
yoff2+=0.1;
}
endShape(CLOSE);
strokeWeight(80);
stroke(0);
noFill();
beginShape();
float a=0;
while(a<=TWO_PI){
a+=0.2;
float offset=map(noise(xoff,yoff), 1, 2, -25, 25);
float Radius=height/4+offset;
float x=Radius*cos(a);
float y=Radius*sin(a);
vertex(x, y);
xoff+=0.1;
yoff+=0.1;
}
endShape(CLOSE);
filter(BLUR,5);
popMatrix();
}
Thanks so much,guys
Answers
@BianYx --
Have you looked at the Processing Curves Tutorial?
...and, in particular, the bezier functions and examples?
@jeremydouglass
Thank u man. I have tried with curves before,but didn't succeed. What I want here is a transformation way of the shape which is smooth as a shape generated with bezier. And what I have now, the shape transforms,but not that smoothly. Could u please check this video. https://vimeo.com/161936471 I surmise that this effect is not totally created by bezier.Probably it is something like I have done.(Maybe I am wrong). Thanks again for your respond.
It's always hard to reproduce a certain look perfectly. But it would be a copy anyways and not as interesting as creating something unique. So to adress your problem: "I have tried with curves before,but didn't succeed." - doesnt count. Show some sample code whit curves so we could find out where your problem is.
jeremydouglas has linked some relevant functions, i would additionally suggest curveVerteX.
blurring is usually pretty slow, but maybe you do not need it here. See this example, reduced to only one "wabbly-shape", uses transparencies instead of blur. And i used an array to store the calculated points, i find it easier this way.
@Benja Sooo cooool,man! Your example totally kicks ass. As you said, its not easy to reproduce,but thankfully,with your help,I think I am not far to achieve it. By the way, the reference pic I attached is actually did with Adobe Illustrator,thus I guess it would be super hard to realize the same exactly effect on Processing.
Anyway, really appreciate your help.
I am going to move forward now!
@Benja Sorry to bother you again. Thanks to your help,as you can see below,I am quiet close to my destination now. Just I still want to have three "wabbly-shapes"with different colours,but only apply the transparencies on the two bottommost shapes.For now,everytime the transparent rectangle refreshes,the black circle also gets the transparence effect which is actually unwanted. Could you please help me with it? Even a simple direction could be fine.
I think you already had the same idea... I see a declaration of PGraphics at the top of your sketch, but you do not use it. Just draw the first two colors to that PGraphics and the semi-transparent rectangle too.
Then use image() to show the PGraphics before drawing the black wabbly-thing above.
Thank you @benja.I've finished this and applied audio volume to control the motion,it works well!