15,918,889 members
0.00/5 (No votes)
See more:
I'm creating an animation of a guy hitting a sandbag (Imagine the game Grand Theft Auto)
what I'm having problem with is how to simulate the swinging of the sandbag when punched.
The Problem is not in graphical, i have no problem in doing the 3d simulation, what i'm a bit confused is how to create the waving function.

Imagine when you hit a sandbag at its central balance point and at angle 0degree, the sandbag will only move backward and forward in z coordinate. The range of swinging will decrease as more swing have been completed. I've created a math function of that,but it's not really flexible.
I've look at the sinc() function but it's not symmetric(If you look for sinc() at wikipedia, you can see in the graphics that the range is not symmetric; -0.2 -> 1.0)

Can anyone make a function to simulate that? a flexible function where the initial range can be modified dependng on the power of punch.
Posted

## Solution 1

Well, you curtainly picked a difficult topic for the question. The easiest way of threating the problem is to use a bar, like a tuning fork or a free bar:
http://hyperphysics.phy-astr.gsu.edu/hbase/music/barres.html[^]

However sand is nonlinear so it might be a little more difficult to get an excact value.

I could go on and on about this, but Im not sure how accurate you want it..

Comments
yudhistira dewanata 19-Apr-13 2:52am
Thanks for the quick reply, I'll try using the free bar model.
Can i ask for suggestion? what would you do to solve this problem, what do you think is the most efficient way solve this?
Kenneth Haugland 19-Apr-13 5:00am
Well, it depends what you want to show, if the sandbag should burst it would be an entirely different equation but I assumed that it stays the same, then the lest modal solution with a daming element (e^-a*t)should work quite well. The problem is finding realistic values of Youngs modulus and the damping, as Im not aware of any such simulations that you ask for.

As fo rthe Sinc function I have used it to simulate objects falling on the floor, however there are two different versions of it depending if its over or under critical damping.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 OriginalGriff 128 Pete O'Hanlon 100 Dave Kreskowiak 40 Richard Deeming 40 Maciej Los 20
 Pete O'Hanlon 770 OriginalGriff 641 Dave Kreskowiak 445 Richard MacCutchan 320 merano99 260

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900