Random shape gradient

trying to work out how to make a beautiful gradient away or towards the edges of any random shape.

i figured use ofPolyline and cycle though all x y point and always check distance to closest point of polyline. but pLine.getClosestPoint(myP) is the closest vertex in the polyline and does not consider any inbetween points.
also dist method seems very slow. nowhere near real time.

saw this post by zack liebermann. which is not a simple circle.


<img src="/uploads/default/original/2X/4/44b664881f08c6f0534cb908a5b753ddfbf83ba5.jpg" width=“505” height=“500”

How Zach archives his results: https://twitter.com/zachlieberman/status/706105341663174662 … basically overlaying several cycles, shifting them with sine functions, and then blur on top.

i guess that would work.
also some shader based blurring would do it.

i am interested in finding the gradient of this random shape to the edge of an outer bounding shape.

Something about “Boundary value problem”.

I should also look back in to the ofxPolyfit which performs N dimensional polynomial fits.

here my first tests using the distance between two points

Looks interesting … worth a bookmark :slight_smile: