Mathematically random black blobs with degree of freedom

Hi, All.

set-design-vector-illustration-fluid-isolated-on-white-modern-liquid-vector-

I’m trying to generate mathematically random black blobs with this degree of freedom.
​And display it using OF.

How Can I coding it using OF?
Or, what keywords should I search for?

Thanks in advance.
Best,
@bemoregt.

Hi @bemoregt , there are a few ways to do this. You could use ofPath, which will draw a filled shape and has .curveTo() and related methods for drawing curves between vertices. You could also create the perimeter of a blob with an ofPolyline, then tessellate it to an ofMesh and draw it. An ofPolyline will not draw a “filled” shape, which is why you have to get it into an ofMesh. A third way would be use ofBeginShape() and ofEndShape() in ofApp::draw(), with a bunch of calls to ofDrawCurve() between them.

2 Likes

Check out the ofCurveVertex shape in the examples/polygonExample ( turquoise blob )

You might end up wanting less points than that and it’s a little bit of work to get the last vertex not to be pointy, but I think it’s close to what you are after.

2 Likes