Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Splitting a rectangular image to polygons to simulate Breaking glass

I am working on some C# code in which I would like to take a 2D rectangle and split it to smaller 2D polygons. I would like the effect to look like the rectangle was made of glass and it was hit with a hammer in a random spot. I was wondering if anyone knows of a good algorithm to help me with this. I have tried the FortuneVoronoi code using random points to simulate this effect but am having a hard time turning the finished VoronoiGraph in to a set of non intersecting polygons in a reasonable amount of CPU time.

like image 953
Jeff Lundstrom Avatar asked May 06 '11 13:05

Jeff Lundstrom


1 Answers

Since you mention Voronoi diagrams, I'd go for a Centroidal Voronoi diagram built using a radial density function that is concretated on the point of impact plus some jittering to add a bit of realism. See this page and this paper.

like image 128
lhf Avatar answered Sep 19 '22 02:09

lhf