Polygon explosion

Discuss new features and future development.
Post Reply
memmaker650
Posts: 3
Joined: Sat Jul 13, 2013 6:36 am
Contact:

Polygon explosion

Post by memmaker650 »

I'm newbie with Chipmunk physics and want to make an easy example of polygon explosion.

I started with the SmashLogo demo but in this example the are no explosions, only so much ball movements.
I know how to do polygon collision but my dude is for example how to explode a cube into many little pieces.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Polygon explosion

Post by slembcke »

So I have a demo of that in the vanilla C code too actually:
https://github.com/slembcke/Chipmunk2D/ ... /Shatter.c

It splits a polygon into voronoi regions similarly to how you'd implement grid based Worley noise. It's not commented well unfortunately. I could try and give you some pointers if you wanted to use it though. Try it out in the demos and see if that's what you think you want.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
memmaker650
Posts: 3
Joined: Sat Jul 13, 2013 6:36 am
Contact:

Re: Polygon explosion

Post by memmaker650 »

slembcke wrote:So I have a demo of that in the vanilla C code too actually:
https://github.com/slembcke/Chipmunk2D/ ... /Shatter.c

It splits a polygon into voronoi regions similarly to how you'd implement grid based Worley noise. It's not commented well unfortunately. I could try and give you some pointers if you wanted to use it though. Try it out in the demos and see if that's what you think you want.
Thanks, i will try your code and post here the part of the code which define the 'explosion'.
memmaker650
Posts: 3
Joined: Sat Jul 13, 2013 6:36 am
Contact:

Re: Polygon explosion

Post by memmaker650 »

Really nice example.

I will customize the tank demo using the SmashLogo demo for the bullet and the Shatter Demo to apply the explosion/destruction to create a custom demo to show a fire&destroy chipmunk example.

But i'm surprised, the Shatter demo is new. I worked with Chipmunk 6.1.4 and I don't have any Shatter.c file. Nice to see new demos. Good work.

Thanks slembcke.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests