Rotating (rolling) a cube - how?

I am looking for an EASY way to rotate a cube as if it were being rolled across the ground. In theory it’s really simple - just shift the pivot point to the corner that will contact the ground - but to keep the cube rolling would require moving the pivot point repeatedly and I don’t think the pivot point itself can be animated.

I can do it by placing the cursor and rotating around it then keying the 90deg rotations but Blender keeps the object centre travelling at a constant level when it really needs to rise and fall as the cube rolls from corner to face. I can go in and manually edit the rise and fall either by messing with the IPOs or dragging and keying the cube (Actually, the IPO method suddenly has some appeal. Must investigate).

But I’ve got this niggling feeling I’m missing the obvious. I’m not looking for physics-related solutions - just pure old-fashioned animation.

Search here for “Nozzy” and “rolling cube.” I’m pretty sure he had a good-looking solution that used IPO drivers. I’ll attach the file if I can find it.

Hmmm, did try a search for “rotating cube” and got nothing useful. I’ve just found “rolling box” which includes a blend from Robertt so I’ll take a look at that. It appears that he’s used the IPO method I pictured so I’ll see how it all works.

Actually, that thread’s got Nozzy’s post too so I can take a look at that as well.

Thanks CD.

Edit:
Okay, checked out three blends. Robertt’s was too bouncy (like rolling a die), Hazard’s looked absolutely perfect - but used a spinning trick that would prove unsuitable for me and Nozzy’s solution is essentially what I’d already done but with a driver added for repetition. So I guess I’m on the right track…

Here’s the rough animation (800kb) where I really want to apply the effect. The wheel needs to change pivot points as it shifts weight from one edge to the other.

I have other possible solutions in my head (eg. a shifting parent-empty - like a stride bone effect) so if I can get something different/better to work I’ll post it.

Surprised that it’s you whose asking this question as it’s the perfect candidate for Pop-Thru animation… remember… Keith Lango?

%<

Blender keeps the object centre travelling at a constant level when it really needs to rise and fall as the cube rolls from corner to face.

I’m kinda confused by what the problem is. Why not key location and rotation both? This may be Fligh’s point too… I think I’m not totally clear on the question.

When the cube rolls along a surface, it’s centre point must rise and fall. Simple keying at 90deg results in a cube that rotates and moves but does not rise and fall - so the corner edges disappears below the surface. To counter this requires repeatedly draging the cube up and keying (four or five keys per 90deg rotation)

I did find a fairly nice solution using an empty somewhat like a stride bone. The empty is placed on the leading bottom edge of the cube and the cube is parented to it. The cube now pivots on that edge.

http://members.westnet.com.au/andydolphin/blender/BoxRoll.blend <DEAD LINK, SORRY

1: Key cube and empty in start position (LocRot)

2: Advance 10 frames. Rotate the empty 90deg and the empty is now on the trailing bottom edge. Key both again.

3: Advance one frame. Shift empty forward to the location of the new leading edge. Then shift the cube backwards by its own length (it moved with its parent). Key both again.

4: Keep doing this.

This could be carefully controlled using the num panel and is faste than it sounds.

Still not seeing the problem. Here’s my solution. Three keyframes. One keyframe flat on the ground. Ten frames forward, another keyframe up on the corner. Ten frames forward, another keyframe flat on the ground (all of these are Loc Rot keyframes).

Use extrapolation extend mode for the rotation curve and cyclic extend mode for the z location curve. The way I did it has the cube rolling in place, but of course you can key your other location curves however you like…

Is the problem making it go in a direction? Lemme see about that…

<edit> I think I see what you mean now. I get the corners dipping slightly as they turn. I’d probably just be satisfied to add one key per cycle to correct this, but if your way works better it sounds interesting… I didn’t fully understand the description. I’ll take a closer look.

<another edit>
Took a look. Very nice. Good solution.

I originally assumed a few LocRot keys would do it but the dipping into the ground was the problem. When I was keying the “wheel” in my short animation, I was surprised by how much movement occurred that required manual adjustment. Fixing it was easy enough but I just felt there had to be a “better” way. Maybe the LocZ curve just needs to be linear or something? (haven’t tried messing with individual curves)

Of course, the “real” solution to the problem is just to apply a little Pythagoras in the IPO curves and create a nice parabolic curve that moves the centre point up and down and along in relation to the rotation (1.414:1 on a standard cube). I went a little down this road but it was late at night and I couldn’t be bothered trying too hard - plus it would best apply to a regular shape and the curve would need to be accurate enough to avoid slipping and dipping.

I also realized that the way I mentioned requires more keys if the shape is oblong and also the dipping problem is worse. Again, nice solution with the empty.

I like the animation, too.

I did like Nozzy’s solution from that old thread.

Here’s another idea for you smarter more experienced Blenderites to play with.

Add an armature to the cub and put two bones on each each, “fat” side of bone pointing towards either the top or bottom edge. Then assign floor constraints to the bones with a “ground” cube object as the target.

It’s sorta working for the bare armature, I can’t get a cube’s weight painting / vertexes to keep the shape of the cube… hmm maybe more supporting bones 'ala a biped armature :slight_smile:

Maybe slight overkill, but there doesn’t seem to be a simple solution to this seemingly simple problem :slight_smile:

Mike

I did like Nozzy’s solution from that old thread.

Well, now I’m kind of curious. But not quite curious to read six pages of year old posts to find it… assuming I found the right thread.

Nozzy’s solution, as far as I can tell, used keyed frames (the rotation dips and rises a fraction close-up in side view) but he drove the rotation with an empty. I haven’t looked real close.

I’m sure my setup could be driven too but I haven’t yet worked out how to get the cycle to extend properly. In my first attempt, the cube drifted away after one complete cycle. Maybe if I shift its Loc Keys to dLoc? Dunno.

Hazard: Your solution was visually perfect and it was your approach that lead me to my solution. Since the real problem here is repeatedly shifting the pivot point it was a matter of finding a logical way of doing that without rotating the cube’s other axes.

I haven’t tried bones… yet :wink:

How about simply cheating and creating duplicate 4 cubes with different centers? You use one and hide others for segments of the animation.
The path of a point on the surface of the cube follows is a pretty complicated one, specially if your cube is a rectangular. I tried to plot it with spin for various parts of the rotation. It becomes cyclic after a complete turnaround. Then I used the array modifier to turn it into a long cyclic edgeloop, used the edges to curve script to turn it into a path and tried to use follow curve. But the cube moves weirdly along this path…:eek:

The explainations how the file works is on a text file in the blend. The dipping you mention was some keys i forgotten to break, I tweaked it a little it looks a bit better now.

As for you problem if the animation is just going to have the character flipping the wheel a few times, straight forward keying must be enough instead of setting a driven setup.

By using a combination of snapping the cursor to a bottom edge and rotating around the cursor and keying tight should work perfectly.
keyed_box.blend

Thanks Nozzy. I’m not sure yet how perfect my needs are - in reality, the key method will probably be fine but when I was setting those keys I began to think there must be a way to do it accurately - without having to tweak :slight_smile:

can’t you make the cube an actor with a rigid body and record the physics to ipo? or not…

I probably could use physics but like I said in the first post, I’m somewhat old-fashioned. I find some automated solutions lack that “personal touch”.

I’ve never ventured near the physics engine.

Hi AndyD,

this may help http://de.wikibooks.org/wiki/Blender_Dokumentation:_Stride_Path It is in German but you might figure something out. Unformtunately there are not many resources on stride path.

JiriH