Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 21:32pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

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..
  Permalink  
Comments
yudhistira dewanata at 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 at 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)

  Print Answers RSS
0 George Jonsson 175
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 19 Apr 2013
Copyright © CodeProject, 1999-2014
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