explodable terrain

cxxD

26-04-2010 09:17:20

i dont know if this should be posted here but id like to have answers in python, not in c++ or whatever because im not that good in understanding the syntax of it (i can read it but its not really comfortable). Is it possible to make explodable terrain or something like that? how can i achieve bombing holes in the terrain or blowing up houses? im using ogreode for my project. (it should look in the end like the explosions in bad company 2)

it would be really awesome if someone knew what to do. thanks in advance

Gurrier

28-04-2010 14:23:15

As far as I know, blowing holes in the ground is done by editing the heightmap at a certain position.
I'm not sure about the house in OgreODe. But in PhysX is is done by making a 3D model of a house, breaking it up in seperate pieces. Then load the house model in physx and let it cook meshes out of the it. The important thing to do is that you don't cook the house as 1 mesh, but the seperate meshes the house exists of. Then make the cooked meshes static and when you trigger the explosion inside the house, change them to dynamic. And it should blow apart. Then add a particle emiter and a debris emitter and you are done.

still all this isn't easy.

cxxD

29-04-2010 15:28:07

thanks for your reply.. ive thought about that but its really not very nice... i dont want to blow up a house in total i just want to blow it partly... (it would be crappy to know that every thing your hiding behind can be blown away with just one grenade.. so.. ill let that house part away..) but im still interested in the terrain thing. Were still not really sure what our project should turn out in the end but i think this would be useful to know anyway. any docs for that?

Gurrier

30-04-2010 14:31:10

For the terrain?Well you could try the book series "CPU gems". But you could look it up on google how it all works. As far as my knowledge goes...

You have your heightmap (terrain) that is devided in a grid. The explosion creates a radius. How closer the grid point of the heightmap to the center of your explosion the deeper in the ground that point in the heigtmap should go down.

So if you do this on a flat piece of ground you should have a half sphere where the explosion started. Now add something random in the calculation of how deep the gridpoint should go. This will make it less atrificial. Still this is the pure basics. There a lots of different methods.

You could also make different strenhths of joint for the house, So you will need bigger explosions for the walls. And maybe small joints for doors or so. Just keep in mind. Joint in physics aren't easy. And take a lot of time to get right.

cxxD

30-04-2010 16:02:34

now you made me think