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.

This question already has an answer here:

I saw Smash Hit the other day and was amazed by the physics of the game, specially the shattered glass effect:

I've read other posts about this subject but I still feel that they don't share enough details to let me get started on implementing this on my own with OpenGL/GLSL.

Is it possible for somebody with an enhanced perception and graphics understanding to watch the gameplay and give some pointers on how this effect could be replicated?

I rather not use 3rd party physics engine and do the entire thing on my own for educational purposes, so could you mention some of the physics that goes behind this as well?

References to other documents and demos are highly appreciated.

share|improve this question

marked as duplicate by Philipp, Seth Battin, Trevor Powell, Anko, Josh Petrie Aug 14 at 15:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
IMO You really need to pick up some scholarly articles and books and begin researching this. It's not suitable for SE. –  Lightness Races in Orbit Aug 12 at 16:42
    
@LightnessRacesinOrbit I respect your opinion, but I rather hear from someone with experience in Computer Graphics. By the way, I'm not asking for people to teach how the math and physics work, only mention the stuff that goes behind the curtains to make it happen. –  karlphillip Aug 12 at 16:47
    
1) detect collisions 2) fracture the glass geometry 3) apply an impulse to the pieces 4) simulate physics in general. not necessarily in that order. –  melak47 Aug 12 at 16:55
2  
The developer's blog at tuxedolabs.blogspot.se has some discussion of the techniques he used. –  GuyRT Aug 12 at 17:03
1  
@karlphillip: I have plenty of experience in computer graphics. –  Lightness Races in Orbit Aug 12 at 17:04

1 Answer 1

This is a pretty advanced topic. Generally people like to use Boolean Set Operations implemented with a BSP tree for this kind of destruction, which revolves around splitting polygons over planes. Take a look at this paper by Naylor to learn how.

This will let you overlay one mesh upon another and perform a subtraction. The results of the subtraction can give you the mesh with a carved out volume.

You'll also perform an intersection to find the carved out volume itself. Given this intersection volume, you can use any sort of approximation to simulate a shatter effect. Generating random planes and slicing the volume can work! The sliced up intersection can then be simulated as a bunch of rigid bodies, and you can just let them all fall.

Since all of these operations work with meshes you'll need some kind of boundary representation of your geometry. Generally people like half-edge mesh the most (myself included).

Here the author briefly talks about his technology for the destruction in this game.

share|improve this answer

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