download: ==> omino staragon 32 <== a pixel bender filter
Just recently, Dale Bradshaw posted a rounded-rect pixel bender plugin. Pretty nifty!
It got me thinking, What about other rounded-corner polygons? It was a bit of a puzzle. As with all Pixel Bender plugins, the question is, What color is this pixel? How does a given pixel know if it’s inside a rounded-corner pentagon or not?
I stuck to regular and stellated polygons to start. One solution goes like so:
- Divide the plane into pie-slices, one for each edge of the polygon.
- For each point, decide which slice you’re in.
- Decide if you’re inside or outside the edge.
- For the rounding… decide which corner you’re nearest
- Are you in the arc of that corner? If so, decide if you’re inside the rounding-radius.
Well, that was a bit of obsessive fun. Here’s a screen shot, including the parameter controls:
And here’s a little demo of it.
6swtGElxOzs
click for
http://www.youtube.com/v/6swtGElxOzs&hl=en_US&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999
click for
http://www.youtube.com/v/6swtGElxOzs&hl=en_US&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999
download: ==> omino staragon 32 <== a pixel bender filter