Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
1  
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? –  Tetrad Nov 11 '10 at 21:48
    
I just need help with the generation of a crack image, but I am going to use it to break/crack existing objects. –  AttackingHobo Nov 12 '10 at 0:15

4 Answers 4

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.

share|improve this answer
    
Do you have any examples or more theory on this kind of method, your answer is a bit vague. –  AttackingHobo Nov 12 '10 at 23:38
2  
Do you have a reference image for the kind of effect you are looking for? –  echeese Nov 13 '10 at 4:38
    
:P recursions always sound amazing, but then you have to sit down and implement them –  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?

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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