Squash&Stretch Ball in Blender???

Here is a document about my approach.


I’m willing to discuss and brainstorm any approaches to a S&S ball rig but I really have to work on my main project.

i kind of liked the idea of trying this as well, so here’s what I came up with so far.
http://img405.imageshack.us/img405/783/stretchyball01jd9.jpg
Shot at 2008-04-20
you can download it at my site, http://tieleman.m.googlepages.com/hidden225
it has some issues, like there is some distortion when you move the floor higher than it’s current location, I should lock the z axis or something, and I don’t know how to make the rotation follow along a path or something.
But it does rotate and stretch independent from each other, has a pivot in the center and at the base.
It works in Vanilla 2.45.
It’s not perfect, but I’m curious what you think of this approach so far.

This is one of those things I’ve thought about for ages but never had the fortitude to actually try to figure out. I’ll definitely be looking forward to seeing how this develops.

I guess to solve all problems including real auto rolling. But I still have to wait for final Blender 2.46 release. Then make blend available including tutorial (I hope).

FreakyDude I have just seen your floor rig in at your website. It is really freaky, really have no idea how did you do this. It seems like some kind of magic. :eek:

it’s not, it’s some funky parenting tricks, no constraints or nothing. Glad you like.
For the ball, I have no idea how to do the auto rolling, I could constrain the armature object (not the floor bone) to a path or something to change the floor if needbe, but this autorolling is something I need to research more…
There’s bound to be a way in vanilla 2.45 that works…

What about you guys, any ideas or progress on this?

OK. Thanks for the blend file and letting us look at your approach. I downloaded it and just tested it. Maybe it is because I don’t know how to use it but I can’t change the stretch direction. I thought the the double arrow was there to change the stretch direction but no matter how I rotate it, the ball still only stretches along the Z axis. I could not make the ball stretch in any other direction no matter which control I tried. Can you explain how I would do that? Say I want the ball to stretch 10° to the right. How would I do tat?

for auto-rolling, the idea that comes to mind for me is to use global position and movement change to affect bone rotation for a bone that controls the ball’s mesh. Just thinking abstractly, haven’t tried to code anything.

Say you have a python script or whatever that gets current position of the ball and the initial rotation measurements of the bone that will control the ball’s rotation. Then on frame change the new position is retrieved and the rotation of the bone is set based off of that movement on all axes.

Including the diameter of the ball which should be part of the data you could retrieve from the object would also allow for realistic rotation based on movement because you could then calculate circumference of the sphere(diameter * pi) and use that data in conjunction with the movement of the center of the ball to calculate the rotation. It is simpler than it sounds. say the ball is 2 blender units wide then the circumference is 2pi blender units. the ball moves 1 unit so the point touching the ground would roll 1 unit, I think. so you divide the units moved, 1, by the circumference, 2pi or 6.28 blender units and get 1/6.28 multiple by 360 and get 57.3 degrees that the ball would rotate in that direction. each rotation direction would have to be calculated individually for things like rolling up or down a hill or diagonally.

makes sense to me, but not sure how easily coded it would be, sounds simple enough.

oh, and a lattice for squash stretch, that would kind of screw up the simple rotation formula though because the circumference would change, not sure if you can get the live diameter from the object in each of the 3 axes, but that would alleviate that problem as well.

Just thinking out loud, maybe I’ll have to look more into, but kinda busy right now.

I think I may have a relatively simple solution utilising 2 bones and a shape-keyed lattice in version 2.45 (unless I am completely misunderstanding you). You can see a short animation here (380 KB) and find the blend file here (200 KB). The lattice deforms in the X and Y directions to enable one to maintain the ball’s volume. When it lifts off the ground after the bounce, I built a deformation “wobble” into it. Let me know if I need to explain the file.

The 3 pictures below show the first 3 bounces (I exaggerate the deformation quite a lot):




@anymation - you are spinning the ball by keying it though rather than it auto-rotating, I think that was the key part of the original request, but I could be wrong.

I did not quite read the auto-rotate into the initial posting, but - looking back - I think I can see it.

Anyway, here is an updated version, where I use an IPO driven channel that lets the ball rotate based on its X-location. Then it is merely a matter of scaling the rotational speed of the ball’s axis correctly. I further determined a non-linear IPO curve: to simulate the ball initially rotating slowly, but picking up angular momentum as it gets more traction from interacting with the floor, until - eventually - the ball rotates at the speed it moves along the floor.

Is guess that is meant by auto-rotating… The animation is here and the blend file here.

It also still squashes correctly according to my understanding.

That’s a funky approach, certainly didn’t think about that.
So the rotation is driven by the x location… the squashing is manually keyed correct?
The squashing happens from manipulating the lattice directly in editmode? Hmm that has the advantage that the pivot is wherever you want it. Want the center, use median, want the bottom, set the 3D cursor at the bottom and scale from the cursor. And you don’t need a rig to set it up.
Might I ask why you took a lattice with 27 points instead of 8? And why does it have those shapekeys? Those are keyed, but I don’t see how you’d not just manually key those? Could you care to explain a bit more how this is exactly setup?

@Ypoissant. I didn’t realise you also wanted to stretch in other directions. I figured skew would be enough.
You can easily fix that by unlocking the X and Z scaling for the double arrows. I don’t know how you would squash 10°, you can rotate the arrows, and scale it’s local y axis, but that doesn’t make the squashing also happen at an angle, that’s driven by the lattice, which stays upright. You can stretch it in the x and y axis though, if you unlock them, and you can skew it with the top bone.
It’s not perfect either way…

I’m a fan of one-rig-controls-all setups. but I like AnyMation’s approach… simpler and more direct.

FreakyDude, I did not really need the 27 points, but it did give me the possibility of a non-symmetrical squash if I wanted… but you can easily manage with only 8 points.

The clincher of this design for me is the IPO driven channel because - once I set the scale, I can move the ball anywhere along the X-axis… and it will rotate in perfect harmony with the ground plane underneath it.

I used shape keys because then:

  • I do not have to re-do the deformation every time the ball bounces. Shape keys are just easier: you merely decide how much deformation you want at every bounce.
  • Furthermore, I get a much better idea by looking at the IPO curve to get an idea of by how much I have to reduce the deformation at a particular bounce compared to the one I am currently at. I took a rough rule of decreasing the ball’s bounce height, as well as the deformations by 2/3 from the previous bounce.
  • Lastly, I just duplicate the IPO curve’s points at every bounce and drag them to the right to the current bounce frame, scale them by 2/3 vertically, and I have a new deformation. No need to manually key at all.Of course, I did not think about all these advantages up front, but they kind of make sense now - looking back :wink:

AnyMation



That is exactly the difficult part. Nobody have solved this yet.

You can easily fix that by unlocking the X and Z scaling for the double arrows. I don’t know how you would squash 10°, you can rotate the arrows, and scale it’s local y axis, but that doesn’t make the squashing also happen at an angle, that’s driven by the lattice, which stays upright. You can stretch it in the x and y axis though, if you unlock them, and you can skew it with the top bone.

Unlocking the 2 other axis in your setup does not solve that issue either because it now scales on all axises. Rorating the lattice will not do either because it also rotates the ball.

@AnyMation, Same issues there. the stretch is controled by the lattice and when we rotate the lattice, the ball rotates also.

Here is the justification about the ball stretch direction. Go see the stretch direction in step 4 and 5 from this page. Notice that the ball stretch direction follows the path direction. That is the traditional animation way of applying the squash and stretch principles. As you can see, the ball rotation must be independent from the stretch direction and the stretch direction must be rotatable too.

ypoissant, I did not realise that you wanted it to stretch along the “incoming vector” and “outgoing vector”, but I am not convinced that it is absolutely necessary…

The issue here is FRICTION:

  • If you assume NO friction, then the squashing is only in the Z-direction
  • If you assume there is friction, then the ball’s will rotation will speed up for the moment it tries to make contact with the ground. And then the ball will:[LIST]
  • Squash along the incoming vector
  • Rotate momentarily as it makes contact with the ground (actually increase its angular momentum. It will do so every time it hits the ground until it eventually just rolls along.)
  • Stretch along the outgoing vector as it takes off [/LIST]I think there are a few considerations here:
  • Firstly, the ball has to come in at quite a low angle for anybody to see that the squash is not actually merely in the Z-direction, but actually along the incoming vector. If the ball does come in at such a low angle, the squash should typically be negligible anyway (unless it comes in at a very high speed and then the object would probably disintegrate anyway :)).
  • If one tries to animate it 100% correctly, one is actually venturing on the physics domain, where one can then start thinking about using a physics engine…
  • The ball is probably the most difficult to do, because it is round and therefore “directionless”, i.e. if one was anymating a figure, one would typically squash and stretch along the figure’s main bone structures, such as the well-known figure below indicates. (BTW, the ball in the figure is actually an animation “cheat”, as a dead object, such as a ball, cannot really pre-empt the stretch along the path (5 and 12). But, OK, it is a good animation principle.)

One has to trade the physical accuracy against the illusion one wants to create with the animation. I am trying to be practical, but maybe I am just lazy… :slight_smile:

AnyMation

@AnyMation, The point of my search for a non physically plausible squash and stretch ball is to be able to do “traditional” squash and stretch animation exercises. The squash and stretch ball, although not physically based, is still the first step that would lead to more complex character based squash and stretch exercises. Also, even for character animation, it may look like the squash and stretch only happens along the character orientation but that is only true globally and generally. When you look at each body parts individually such as the limbs, this is not true any more. And when you loook at each limbs individually, it is not even true that the stretch happens along the length of each limb.

BTW, the kind of squash and stretch that is displayed in your image from Preston Blair and in every basic bouncing ball animation lessons is done that way both for simulating motion blur, which we don’t really need in 3DCG and for exagerating the visual dynamics of the motion. That is what cartoon is made of. Physical plausibility is something an animator should always be aware of and keep in mind but for visual impact, the physical plausibility may be tweaked, exagerated and even turned over like in Tex Avery animation style.

Haven’t read most yet, I have to leave in 5 mins, but you can scale in any axis you want. Just constrain the one you want to scale.

It looks to me like anymation’s results are pretty darned close if not golden. The empty acts as a handle and getting rid of the shape keys allows the lattice to be stretched in any direction, the lattice doesn’t need to be rotated, it just stretches the ball. Still rotates when stretched too! If you use lattice for the keyframe, you can key in those lattice shape keys also.

@Anymation - how difficult would it be to use the Y direction for rotation as well. I guess I should just look at those IPOs you put in there. very interesting rig.

ypoissant, I am not sure how else to do it… or rather, I have some thoughts one could potentially investigate further, but not the time.

bgstratt
, I think rotation in another axis is actually going to be problematic, as the ball (as an object) will then wobble. For that, one would have to revert to parenting it to a (horizontal) bone, where quaternions are used. Even then, one would rather change the direction of the bone, while still keeping it horizontal. I think that it may actually be a problem.

In the mean time, I changed the animation slightly earlier today to have a “speed hump” in there. It’s still only moving in the X-direction (obviously, the hump is in Z) and I can probably spend some more time to get the speed changes 100% (although they are close), but I am satisfied that one can get the ball to roll over a bump relatively realistically. But it takes a bit of effort, as one has to interactively play with the IPO driven channel and the Y and Z-loc IPO curves.


Dear Blender fellows, after weeks and weeks of developing it is already here.
Let me introduce you my “ultimate” squash & stretch ball rig including autorotate switch:
http://blenderartists.org/forum/showthread.php?p=1102523#post1102523