Paweł Mogiła's game development blog

Terrain destruction vol.3 July 21, 2011

Filed under: destruction,gamedev,videos — szaman @ 18:35

Finally, physics destruction is completed, I have reduced number of triangles per object to necessary minimum by storing object envelope in it. Than when collision occurs I make geometric difference between ground and explosion vertices, in this example it is simplified circle, but it can be everything (just imagine laser which creates deep but slim holes – great for passing). Final concave polygon is triangulated. Graphics and physics store the same triangles and as far as that’s good for graphics is not as efficient for physics (convex polygons are better)

Another new thing is the animation, created using ExploTexGen. It can generate texture that contains  sequence of smaller images. I only have to manipulate texture coordinates to jump to the correct place – position of the next frame.

Here is video where you can see this news. In middle of film you can see bullet controlled by mouse (I stopped simulation then grabbed it) Ps. youtube screwed my video : (


4 Responses to “Terrain destruction vol.3”

  1. Nice tech demo, I am doing something similar in regards to terrain destruction. Although at the moment i am having trouble triangulating my polygons. I am how you are handling the triangulation, and if you have holes and stuff working.

    • Sorry, That was a question, Stupid typo. How are you handling triangulation and holes?

    • szaman Says:

      For triangulation I’m using “poly2tri” It can handle holes but… as I noticed, only that which are inside triangulated polygon, if there is at least one hole vertex outside vertices of triangulated polygon then triangulation fails and you might get weird results. So additionally i found “clipper” polygon library that can easily calculate boolean actions on polygon (such us difference, union, xor and more)

  2. […] the beginning I want to say that approach mentioned here in my earlier post – so creating sequences of frames consisting for full animation of explosion was totally […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s