ASP scripted physics simulation - bouncing ball with gravity
Moderators: Víctor Paredes, Belgarath, slowtiger
ASP scripted physics simulation - bouncing ball with gravity
I understand that you need the pro version to use the scripting feature but I just have to share my latest discovery!!!!
I am so freaking excited about the possibilities!
This proof of concept animation has no key frames. It is entirely controlled by a script:
http://www.lowrestv.com/moho_stuff/scripts/gravity2.mov
I will be documenting my progress and posting files and samples in this thread if you are interested:
viewtopic.php?t=9488
Believe it or not adding in collision detection with other bones should be very simple. I plan to add in some sort of bone controls for changing gravity and bounce and for having multiple bones with different values.
My next test will be to add additional bones to simulate squash and stretch.
I'm freaking out!
-vern
I am so freaking excited about the possibilities!
This proof of concept animation has no key frames. It is entirely controlled by a script:
http://www.lowrestv.com/moho_stuff/scripts/gravity2.mov
I will be documenting my progress and posting files and samples in this thread if you are interested:
viewtopic.php?t=9488
Believe it or not adding in collision detection with other bones should be very simple. I plan to add in some sort of bone controls for changing gravity and bounce and for having multiple bones with different values.
My next test will be to add additional bones to simulate squash and stretch.
I'm freaking out!
-vern
- Banterfield
- Posts: 138
- Joined: Tue Aug 03, 2004 10:40 pm
- Location: Colorado
- funksmaname
- Posts: 3174
- Joined: Tue May 29, 2007 11:31 am
- Location: New Zealand
Check the first post in the other script thread for the newest update.
Now you can add your own bones all on one layer. Have as many bones as you want and they all fall and bounce around.
It's a bit of a "one trick pony" at the moment but it is so easy to add in new features it will get better pretty quickly.
I have a new idea! I plan to have the script look for the last key frame of a "gravity bone" before starting the simulation.
So, a character could be holding an object and walk around with it then just throw it. Have a key frame on that last spot and it will use the simulation. The simulation would be based on the last location of the bone rather than the frame 0 location. This thing ROCKS!
-vern
Now you can add your own bones all on one layer. Have as many bones as you want and they all fall and bounce around.
It's a bit of a "one trick pony" at the moment but it is so easy to add in new features it will get better pretty quickly.
I have a new idea! I plan to have the script look for the last key frame of a "gravity bone" before starting the simulation.
So, a character could be holding an object and walk around with it then just throw it. Have a key frame on that last spot and it will use the simulation. The simulation would be based on the last location of the bone rather than the frame 0 location. This thing ROCKS!
-vern
- Banterfield
- Posts: 138
- Joined: Tue Aug 03, 2004 10:40 pm
- Location: Colorado
.... uh... what? What exactly moves on the z axis? Bones can't move on the z axis... so no... can't be done.Banterfield wrote:Also, wondered what would happen if you allowed (or implemented) it to move along the z axis.
edit:
You could scale the mesh or move the vector layer to create z axis movement. Could be pretty convincing if done right.
-vern
- Banterfield
- Posts: 138
- Joined: Tue Aug 03, 2004 10:40 pm
- Location: Colorado
What about the layer attached to the bone? I'm in Ubuntu right now, or I'd just try it myself sans question.heyvern wrote: edit:
You could scale the mesh or move the vector layer to create z axis movement. Could be pretty convincing if done right.
-vern
edit - I suppose it doesn't matter if is scaling or being shifted on the z buffer so long as it can be controlled in a mathematically appropriate way by your script.
Last edited by Banterfield on Sat Sep 22, 2007 12:07 am, edited 1 time in total.
Dave
- Banterfield
- Posts: 138
- Joined: Tue Aug 03, 2004 10:40 pm
- Location: Colorado
Vern, are you sure that isn't because you have 3d camera turned off? I just tried it (changing z value of the bone layer) and it worked - I rotated the workspace to make sure I wasn't being a muttonhead. Not individual bones, mind, but the bone layer.heyvern wrote: .... uh... what? What exactly moves on the z axis? Bones can't move on the z axis... so no... can't be done.
Perhaps you meant individual bones?
Dave
Yes the bone layer can move on the z axis... but not the bones.
Adding a z axis to this script would be an absolute and total nightmare. Not even going to try that. Too much math, too many variables to keep track of. Can you imagine? Random bouncing and collision detection in 3D? Yikes... my head hurts just thinking about it.
If anyone else wants to fiddle with the script be my guest.
-vern
Adding a z axis to this script would be an absolute and total nightmare. Not even going to try that. Too much math, too many variables to keep track of. Can you imagine? Random bouncing and collision detection in 3D? Yikes... my head hurts just thinking about it.
If anyone else wants to fiddle with the script be my guest.
-vern
- Banterfield
- Posts: 138
- Joined: Tue Aug 03, 2004 10:40 pm
- Location: Colorado