13,457,409 members
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 18-Apr-13 20:32pm

## 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 290 Maciej Los 190 Jochen Arndt 190 ppolymorphe 160 CHill60 150
 OriginalGriff 5,810 Maciej Los 3,305 CPallini 2,132 Richard Deeming 2,065 Jochen Arndt 2,005

Advertise | Privacy |
Web03 | 2.8.180322.1 | Last Updated 19 Apr 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100