math & physics
onidaito at May 19th, 2011 18:47 — #1
Hi guys. I was wondering if anyone had any thoughts on breaking geometry? I've been looking around and I can't seem to find much on the subject. Lets take a simple example, a glass bottle that isn't hollow (to begin with - a normal closed mesh)
I thought that maybe a recursive split with arbitrary planes. So you draw a plane that divides the mesh into two, then do the same to these two bits etc, but then one would need to cap these bits that are made.
Maybe representing the whole mesh as a voxel set and then using something like bullet physics on each block? That might look a bit poor later on though (though perhaps voxels may have something?)
Essentially the explosion or breakage doesnt need to be utterly correct but a good looking set broken bits with some specification of where the break starts would be the goal.
I believe Red Faction and similar tend to precompute their destruction animations to a degree. I cant seem to find the original post I saw on this. I'd have thought this would be a common problem with a few solutions (even though its a tricky one. Anyone know of any papers or similar on the subject?
reedbeta at May 19th, 2011 18:59 — #2
In games to date, breakable pieces are almost always hand-modeled. There may be a few different kinds of fragments that are chosen randomly by the game engine each time an object breaks, to improve variety. There is Havok Destruction (see video) that somewhat automates the process, but it looks like it's offline (i.e. fracturing the object in Maya then using those generated pieces in-game) - not generating fractured pieces on the fly in real time. No doubt there's been some research into real-time breaking and fracturing, but I don't know of any off the top of my head.
thenut at May 19th, 2011 20:23 — #3
See this video. That game is powered by the DMM engine. The original paper describing the algorithm can be found here. Keep in mind Pixelux spent several years on that algorithm and fine tuned it. It's no walk in the park, but a starting point nonetheless
A much less accurate, though I believe simpler solution would be to randomize fracture faults from the point of contact with nearby triangle edges. This requires you have a well tessellated mesh to begin with. From there you use a normal physics engine on the fractured entities to simulate gravity. Particle effects/debris add to the finishing touch.
onidaito at May 20th, 2011 06:15 — #4
Thanks guys. I found this:
It claims to be using bullet but obviously its in Maya and there it probably some scary precomputing going on there. But yes, I shall check out these links and see whats what. Cheers!
rouncer at May 20th, 2011 09:22 — #5
yes, very tricky subject, one maybe would opt not to add it, unless the game depends on it, tricky stuff.
I dunno if it would work, but you could project the model onto the cut axis, draw a line, intersect all the lines with the plane, then adjust indices, but then remember you have to actually pass them both as separate objects back into the physics engine.
if you want texture coordinates, that would take interpolation, actually its pretty similar to how youd code the mesh editor in 3dsmax.
onidaito at May 20th, 2011 16:56 — #6
The idea of a slice is a good one because Im thinking mainly about bottles and glass. That tends to be larger chunks and slivers so maybe doing that is not such a bad idea. Of course, the capping is an issue but then generating some triangle strips from the indicies to 'cap' them is not a bad idea.
Precomputing that sort of thing may indeed work for what I have in mind. It might not need to be realtime I reckon. Thanks for the tips guys. It generally does seem like a tricky problem