We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Simulate broken glass
Page Index Toggle Pages: 1
Simulate broken glass (Read 787 times)
Simulate broken glass
Jan 16th, 2009, 8:17pm
 
Hello all

i am trying to generate broken / shattered glass (fractions) on the screen. It should look different every time.

Examples:
http://www.bigtrapeze.com/images/iphone_crack.jpg
http://iphone.macworld.com/images/2007/08/shatterediphone-large.jpg

What's the best approach for it? I already tried some L-System and noise code without good results.

Thanks for your help,

elsys
Re: Simulate broken glass
Reply #1 - Jan 17th, 2009, 6:15am
 
sounds like you need some subdivision.
i'd recommend starting with a voronoidiagram.
you can get that running quickly by using the mesh-library from http://leebyron.com/else/mesh/
by tweaking the right distribution of nodes you input, you should be able to achieve a look like broken glass.
maybe noise works, maybe you'll need some attractors too...
then you'll have a geometric clean subdivision. you could get at the points and edges you get back from the voronoi and make further tricks to add distortion and features you'd expect from broken glass.
Re: Simulate broken glass
Reply #2 - Jan 17th, 2009, 1:35pm
 
Interesting, Lenny. I wonder why this library isn't in the Libraries page, it seems useful. I will play a bit with it.
Re: Simulate broken glass
Reply #3 - Jan 19th, 2009, 3:36pm
 
Thanks for your hint! I will try it.
Page Index Toggle Pages: 1