From: Andrew_M on 12 Mar 2010 03:26 makc wrote: > I have specified point inside polygon, and - well - polygon. I want to > paint the point white, and polygon perimiter black, and then smooth > gradient inbeween. > > For convex polygon, I would split it in a fan of triangles and > gradient-fill them, but for concave polygons this will not work > because of self-intersections. If I try to extend this algorithm by > dropping lots of points inside and applying delaunay triangulation, it > is not clear to me how to assign colors to vertices :( You may try one my tiny prog, intended to demonstrate more complicated methods for gradient fills, than linear or radial gradients. It is not just what you need- there is no bounding contour, but some points, where function is set to zero. Non- zero value is assigned to cursor's hot spot (and this is not the maximum value of a function). All what you need is to move cursor and look at what happens. this method is based on biharmonic equation, but for your purpose harmonic one is better/ But, in any case, it is rather interesting. May be, you'll get some ideas, looking at how gradient fills (or filling?) could be realized. Prog is availible at http://www.smartfills.com/Html/newexamp.zip ..
First
|
Prev
|
Pages: 1 2 3 4 5 6 7 Prev: Call for Participation: CHR Summer School Next: boost with nasm |