I would want to have the ability to simulate different variables like brittleness, or other variables to get varied end results.

I would mainly need to generate impact cracks, so it would need to react to different impact angles and speeds.

I am using ActionScript3, but general theory answers will be helpful as well.

  • 1
    \$\begingroup\$ Are you talking about randomly generating crack images to overlay on top of a material, or do you actually mean procedurally cracking an existing object? \$\endgroup\$ – Tetrad Nov 11 '10 at 21:48
  • \$\begingroup\$ I just need help with the generation of a crack image, but I am going to use it to break/crack existing objects. \$\endgroup\$ – AttackingHobo Nov 12 '10 at 0:15

You could use a recursive function to generate a root crack, and along that root crack, generate smaller branches of cracks, and so on. You could even animate this to make the effect even cooler.

  • \$\begingroup\$ Do you have any examples or more theory on this kind of method, your answer is a bit vague. \$\endgroup\$ – AttackingHobo Nov 12 '10 at 23:38
  • 2
    \$\begingroup\$ Do you have a reference image for the kind of effect you are looking for? \$\endgroup\$ – Ryan S Nov 13 '10 at 4:38
  • \$\begingroup\$ :P recursions always sound amazing, but then you have to sit down and implement them \$\endgroup\$ – dreta Mar 12 '12 at 22:02

Recursion sounds like the right idea, but that alone doesn't cover it. If you want to include things like impact angles things an get pretty complicated. the simple way is to just use the angle as a way of calculating approximate force. using the approximate force and the brittleness you can calculate the size of the initial cracks and the depth of recursion.

If you're really looking into breaking an object along the cracks, Binary Space Partitioning might be something to look into. otherwise, generating textures is probably your best bet.

EDIT In response to your request for an example:

You can take a line, straight or jagged, and pick several points along its length from which to draw other, smaller lines. off of those you can draw yet smaller lines. look into fractals if you want detailed examples. Are you looking for code?


For procedural destruction, I've always been a fan of Voronoi diagrams.

If all you're interested in is the shape of the crack itself, then you can use a Voronoi diagram, and discard all but the boundaries between two cells. If you wanted some variability between materials, you could adjust the number and placement of seeds.


You could probably use the same method of generating lightning to simulate cracks. Here is an example. You might need to tweak it to look right for a crack though.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.