View Full Version : a bouncing basket ball
KerryTouch 11-23-2006, 07:24 PM Hi, I am new to maya, and i am trying out this in the ple, but cant get my head around the logic to do it.
What I am trying to do is have a wall and a floor, both are passive objects. So far so good.
The basketball I want to squish when it hits the floor, or wall.
But Maya wont let me make it a active rigid body, and a softbody at the same time.
Can anyone please help me with this so i can have the ball handled by dynamics, I didn''t want to keyfrme the positions. (which I do have working, initial z velocity)
but to have the ball squish when it makes contact is just a little to much for me, so any help you can give would be really great.
Thanks
Kerry
|
|
Pyrokinesis
11-24-2006, 06:22 AM
In my opinion you will get a much better result animating the object, though you "can" use dynamics, I think you will get a better simulation animating.
Here is a link to a tutorial on how to create a rigid soft body. Its at the bottom of the page. If you are really interested in dynamic simulations, check out the rest of the site, this guy is inspiring.
http://petershipkov.com/
STEVE33304
11-24-2006, 09:57 AM
Hi here is a solution, that allows to you to use both softbodies and dynamics.
Your idea, really SHOULD be easy, but it isn't that easy, i also looked at the peter site, his solution, does not really keep "enough" volume, esp. if you slo-moing the splat sequence.
So here is a method that will work, and the results are good, and its flexible to allow you to change the Splat size.
I hope you like it, and the way i've made it easy for you to adujst things.
Ready....Set...here goes.
1) Create a nurbs plane, and scale it to cover the default grid..
2) Duplicate the plane.
3) Scale the duplicate to be a little smaller, so you can easily select it easily
4) DOING WATER DROPS, rotate BOTH planes the same amount, 10deg or so, this is so they (water will slide down.) You can do the same with the basket ball too.
5) Create a sphere, default size is fine.
6) make a soft body, dup-make copy soft, yoou dont want to hide the copy.
7) outliner, select the original sphere (nurbssphere1) then make it an active rigid body
8) select the larger plane, and make this a passive rigid body.
9) select the particles in the copy of nurbs sphere, and additionally select the smaller plane
10) goto particles and then select make collide.
Your setup. You may want to hide the nurbs sphere 1.
Now if you move the larger plane (and make it not renderable too) so thats it lower then the collide (particle plane then that distance will make the "SPLAT" bigger or smaller.
Try rotating both planes, and you'll see it slide down.
You should change the "bounciness" in the chanell box for the nurbs sphere1, to a ver low or 0 number, this will make it not be repeled. (specific if you ant water, sort of hit and slide.)
You can also change the static and dynamic frictions to a large number, again for water, hitting and sticking.
for your basketball, you probably could leave things as they are. But adjust the space between the two planes.
For even more fun, you can make the nurbs planes, have a u - v paramters of 4 each, so you get more iso lines, to do this select the plane then the chanel box. Adjust the patch v and patch v.
By doing this you can not select the hull's or CV's to really play with the shape of the planes, and you "Stuff" will "Stick" and "Slide"
Hope you find it easy to follow, just try it out step by step, and play with the distances, and the nurbssphere1 dynamic parameters to get more of the cartoony or realistic feel.
Cheers
Steve
Letterbox
KerryTouch
11-24-2006, 02:16 PM
HI,
thanks lustbreaker for the site........maybe one day i will get to be this good (hopes)
Steve, a huge thank you, you are the man !!!
now i can use of both soft/rigid bodies, how ever did you come up with it??
Either way its great, as i am a starting out, its easy for me to change the parameters in the c_box. And move the planes apart.
After trying it i love the crazy cartoon effects, like looneytunesi i can get too, so i might even go that way in the animation.
Thanks both again for your great help (speedy too) to a simple novice like me. Your Great.
Kerry.
Sphere♥
11-24-2006, 02:59 PM
Hi KerryTouch, you could do it entirely with soft body dynamics. I wouldn't recommend it for an important deadline since pure soft body spring dynamics can be difficult to manage, but since you are learning and playing around, I thought you might find this fun... I did.
Here is a very simple example animation I made of a ball using only soft body dynamics:
http://video.google.ca/videoplay?docid=8647973913377453647
This ball is made up of soft body particles held together by springs with a high stiffness. To keep springs with high stiffness under control in Maya (they can blow up) you simply oversample the dynamics. To save myself a lot of typing and explanations I'll just provide you MEL code that you can execute and follow. In a new empty scene execute the following (Window>General Editors>Script Editor, paste following MEL in white area, then press CTRL+Enter):
polyPlane -n Floor -w 100 -h 100 -ax 0 1 0 -ch 1;
polySphere -n Ball -r 3 -sx 20 -sy 20 -ax 0 1 0 -tx 2 -ch 1;
move -y 15;
soft -c ;
Gravity;
select -r Ball ;
collision -r 0.5 -f 0.5 Floor;
connectDynamic -c Floor Ball;
spring -noDuplicate false -minMax true -mnd 0 -mxd 4 -useRestLengthPS true -s 90 -d 0.5 -sfw 1 -efw 1 ;
EditOversamplingForCacheSettings;
setAttr "dynGlobals1.overSamples" 10;Because we are oversampling, you will be prompted to modify the Playback Speed, you can, but you don't need to, just press Ok. Set the number of frames in the animation high enough, then play the animation. The ball should drop on the floor, squish, then bounce. The springs' stiffness will control the squishiness. The key here is the number of springs, using MinMax; we are putting plenty of springs to hold the ball together, but not too many to make the ball too stiff.
To set the ball in motion, it's not as easy as rigid bodies because you need to set every particles' dynamic properties. Now rewind the animation, then you can try putting the ball in motion with this MEL (where velocities: x = 10, y = -10 z = -10):
{
int $p = `particle -q -count BallParticleShape`;
int $i;
for ($i = 0; $i < $p; $i++) {
particle -e -or ($i) -at velocity -vv 10 -10 -10 BallParticleShape;
}
}Hope you find this useful... have fun!
Sphere♥
11-24-2006, 04:08 PM
I thought I'd add that in your case the easiest thing is simply the rigid+soft (goaled soft copy) as pointed out earlier. Still, full soft body spring dynamics can be useful to animate true soft object dynamics. If you are interested, some other basic (silly) examples I had made:
Floppy A: http://video.google.ca/videoplay?docid=-2469143978908288412
Jelly Cubes: http://video.google.ca/videoplay?docid=5574435380321230305
Soft Box: http://video.google.ca/videoplay?docid=708233611759928304
Pyrokinesis
11-24-2006, 08:42 PM
Sphere,
Thanks for sharing I really enjoyed those.
drmerman
11-24-2006, 08:49 PM
Sphere♥ : So YOU'RE the guy who did that jelly-cubes animation! Awesome work mate, and really effective rendering as well. Any more handy tips you can throw our way would be VERY appreciated :thumbsup:
Sphere♥
11-24-2006, 11:45 PM
:surprised Yikes, how could you remember, it was so long ago... time flies. It was all new to me, I had no idea what I was doing then... and nothing much has changed. :blush: Life gets in the way, but oh well, as long as we're all having fun. BTW drmerman really nice work with Maxwell, I lurk there, amazed, but us non-VIPs can't post.
http://www.ipoditude.com/archives/oompa.jpg
drmerman
11-25-2006, 05:45 PM
Ha! Cheers mate. I can't post much of my actual work over there, but its a nice little community if you ignore the ongoing arguments :scream:
But yeah, I remember seeing that scene ages ago when I was just starting out and thinking that the guy who did it must be some kind of sorceror or something. It looks great, man :thumbsup:
KerryTouch
11-28-2006, 09:40 AM
firstly thankyou to lust steven & sphere.
lust your link was great, but it think will will take me a time to get there, interms of the ability of the man. But thanks for the post. Hopefully, this beginner will get there.
Sphere, your mel solution definatly worked, i tried the test scene, and it worked well. I dont think my pc though (not the fastest) copes well when i hit playback. I dont know enough about mel, but i have tucked your idea away for a future date. Thanks
Steven, what can i say, wow, the playback speed is amazing, and i (which is easy for me) can adjust the soft and hard bodies via the chanel box, which is great as i can see what they do. And learn how they effect things.
I dont want to judge everyone's merits but, i do want to say thank you to all for supplying these three great idea's. thank you very much.
As for right now, i will be choosing steven's as the way to go, it smacks of one of those ideas, that i have heard about, when one gets a job, get it working fast, know what you use, get it working fast. And make it easy to change. i know fast was twice ;-)
It seems to me talking to people in the industry, that the "trick" steven created, happen's alot with tight deadlines. I did show it to my lecturer, he thinks its a "production idea' that happens when you need to change things rapidly and gotta get it out the door. And you dont want to rely too much on exact simulations, but control them like this example.
It would be interesting Steven, if you read this to let me know how/why you came up with this. Thanks.
But again, thank you all who have helped me, and the speedyness of your replies, makes me think that the maya community (whatever autodesk do) is a great place to be.
Kerry.
KerryTouch
11-28-2006, 09:48 AM
again thank for those examples, i notice my playpack speed if very slow, with all those springs, (and they are very sensitive, they often explode, which can be fun).
But the question was what kind of processor, ram, etc do you have?
thanks in advance.
Kerry.
Sphere♥
11-28-2006, 04:43 PM
I'm currently using an Athlon64 3500+ with only 1GB of RAM. With springs you would normally optimize and try to have a lot less, only what is needed, and there are many tricks for this. For example, in the case of a rectangle-ish object with lots of polygons (rounded edges and fine details) you would use a low-res lattice deformer grid as a springed soft body shell that will make the entire object appear as a soft body. Also, besides the high number of springs, the example above is slow because of the high oversampling (10X), but I'm surprised you are getting explosions at this high sampling.
But definitly wherever you can get away with soft body goals or jiggle deformers, it's best.
Cheers.
STEVE33304
11-29-2006, 11:10 AM
hi kerry,
i generally dont like the work "trick", but technique. I know that people use trick often, but i feel that it makes my people, seem like .... well novices, and i am aiming to teach them more than that. And i hope they respect and value themselves to know they not just a trickster, but a professional (or getting there).
But in answer to your question, The idea came to be given the fact, that the springs example can "blow up", and novices are not sure how to resolve it. It induces panic ;-)
So i thought of a solution, that would be easy for them to learn. And it had to be able to be a "follow" on from the material they had learned while doing softbodies, and dynamics. Typically both done seperatly.
It had to really only rely on these two items, in their simplest form. And be able to give quick playback, so they could "see" the results, qiuckly, and hopefully not Explode.
Given these set of parameters this is what i came up with. (the 10 steps)
Again to some degree your right in what you have said, that as the industry matures, the mechanisms are not so important, but the quality of the effect, and the time taken to achieve it are.
Again this is why this idea was born, as there is nothing easier (and quicker) for my contractors to learn from what they have already been (or know) taught.
Also it keeps you intouch with what all the paramters do in both softbodies & dynamics, and while learning, repeating the same material only reinforces your understanding of it.
And as for me, if the effect looks good and right, and it only took 1-2 hours to achieve, vs a near perfect simulation that took a week, then yes, i am a happy person too.
After all this businness is now/has learned that time is money. A sure sign that its growing up. And something I see you understand, which will only help you when you start your career proper.
Cheers
Steve
Letterbox
Sharky0815
11-30-2006, 07:31 AM
Hi here is a solution, that allows to you to use both softbodies and dynamics....
Maybe Iīm missing something, but isnīt it essential to make the original, which will become the active rigid body, the goal for the softbody particles? Also, wouldnīt one need some gravity to affect the rigid body so it drops down?
STEVE33304
11-30-2006, 06:19 PM
yes, you do need to add gravity.
and remember is dup-and make copy soft too.
Cheers
Steve
CGTalk Moderation
11-30-2006, 06:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.