Rigging a Rubik's Cube


#1

well, I’ve tried lots of things out already but none of the rigs seem to be very useful. At first sight this seemed a very easy piece to rig but once I tried to find a solution, I realized that a Rubik’s Cube is in fact quite hard to rig properly. The most userfriendly rig atm seems to be just linking all the little independent cubes to a bigger inner cube or sphere (which you don’t see, it’s just there to fill the gaps between the little cubes so you can’t look trough the little holes between the little independent cubes when looked at in profile).
anyway, I then linked the inner cube to a bigger dummy for easy selecting and keying.

So now I’ve got to manualy select a side (with 9 little cubes), rotate it, deselect and select another side, rotate… quite a hassle!

I thinks it’s a nice challenge for all you riggers, I would appreciate it if somebody could help me on this.

Thanks in advance,

Foane


#2

you could try this…
setup a link constraint controller on all the cubes (all separate)
and link them to controller objecst that represent lines (either horizontal or vertical)
and animate them rotating then… aniamte the link constraint and repeat

mark


#3

I’ve tried what you said Mark but all these kind of techniques come down on the same problem, individual animating. I mean, after I animated the controllers I also have to animate the weights of EACH little cube…impossible to work with. The best system would be to have some kind of influence box that ‘grabs’ all the assigned geometry within its boundries. So then I could animate these influence boxes… does this make any sense?

I don’t know if something like that exists in MAX 8 but it would really help me on this.

Thanks anyway Mark…


#4

hi are you sure you tried the link constraint and not pos orientation constarints, link constraint is a transform contoller and does not have any weight(s),
i would say this would probably be your best bet

mark


#5

yeah I know, wrong choice of words…sorry about that

Either way, with the link constraints I still have to fix each seperate cube after I animated the cube (with ‘fix’ I mean giving the small cubes new link targets)

Foane


#6

i wouldnt use link constraint for this, it would become clunky for animation having to readjust all the all the links over time. I do know of a possible way but id have to use my pose tool for it.

So theres three rotations going on , of a possible 27 cubes. You would have to build a dynamic constrainst relationship of a 81 constraints.

For each cube, it has 3 dynamic positions and rotations for each twist axis, so in theory you need a set weight sliders to change what the cubes being driven by. Also a global parent to keep everything local. Umm…

So the number of possible positions is:

You would probably have to deal with localised xform space, on a local root too.

hmm… interesting challenge.

eek


#7

hey eek,

yeah I know, it’s strange how these simple things can get so ugly :slight_smile:
you pretty much summed up the things I was thinking about…lots of data!

let me know if you found something.
cheers,

Foane


#8

I’ll give it a shot this week, if you dont here from me my head will have probably exploded…

eek


#9

ok, thanks Eek

I’ve tried binding the little cubes to FFD spacewarps but that was just gambling… it didn’t work.


#10

Interesting challenge indeed. Not sure what this is for so a complicated solution may be more than is really needed but it certainly does present some curious possibilities.

If I had more time I would play with it myself but with majors deadlines at work and my vehicle rigging series I dont’ have time. However for anyone you might want to give it a shot I will at least say the direction I would go with it.

I wouldn’t animate the 26 individual boes at all. I would look for a way to animate the 6 different sides only. And then what ever boxes happen to be in the volume of that side at the time of rotation get moved with it. This would almost certainly require some scripting but there are lots of ways to find if things are within a certain volume…like volume select for instance. This method would have to assume that no two sides would ever be moving at the same time…or else things would break. …damn I wish I had some free time…


#11

dammit Harvey,

My secret is revealed! hehe ala transforms through volume space

eek


#12

yeah Harvey,

exactly the same thing as I was thinking (and Eek :slight_smile: ). Volume selection could be the key. however, when I use this method on the cube it all works fine untill you rotate a little box that already has been rotated (then the axis are screwed up so the little box turn in a unexpected orientation). It seems that the changing of local space isn’t doing any good…

don’t know Maxscript (yet), so I have to rely on you guys.

by the way, the cube is for my short (thesis). The short is about two burglars, one of them is a real moron and plays with a rubik’s cube all the time…

Thanks,

Foane


#13

From the responses I assume you all are using Max, wich I don´t use (I´m a Blender guy)… so maybe this won´t be of any help to you.

Does Max supports solid body dinamics? If it does them worry no more.

Just assign all your colored cubes some sort of attraction constraint… all linked to a inner sphere or some other filler figure. I´m talking like gravitational attraction, axis independent.

Everytime you push a cube, been solid, it will push it´s neigboors, creating a domino fx that will make the entire row to rotate. It the rows are not well aligned the movement will be obtructed, just like in the real thing.


#14

oh lord…not this again…

I suggested this back in the spring over at od[force]…
http://odforce.net/forum/index.php?showtopic=2731

it’s actually a really dificult problem…at least as I described it…
most of the solutions that people came up with involved either writing data to disk or dynamics or some such thing…but none of those solutions allow for the cube to be animated in a scene by an animator just like any other type of prop…animate forward, back, scrub in the timeline etc etc…
good luck…have lots of asprin around for when you get a headache :scream:


#15

yes, altough I don’t understand most of that Houdini stuff, I do understand it’s not easy at all. it’s a pitty they didn’t found a real solution over there as well. For the moment it looks like my first (stupid) solution was best, just grabbing the cubes of the side you need and rotate them + an easy parented system to have a bit of quick keying control. The thing that Apollux describes is not quite satisfactory because you’re working with simulated dynamics and that doesn’t allow itself to be animated on the fly. Maybe there’s an easy way to fix the problem by just ‘faking’ what the viewport does (where grabbing a side with cubes and just rotating them, but in our case + some sort of animation control). Maybe there’s a way to script the thing, I don’t know if this is hard or not but it would work if somebody could make a piece of code that says: if a certain vertical or horizontal animation control rotates (bound to 90° rotations), then these cubes get linked constrained to it…
but because where dealing with 27 cubes here, each containing 9 potential link targets this could be a bit cluttered doesn’t it?

let’s keep it going…

Foane


#16

Now that I remember, most Linux distros come with an OpenGL screensaver that is nothing less than a self-solving Kubric Cube… source code is alwasys included :thumbsup:


#17

That’s not true at all. There were several workable solutions in that thread. Frank Firching’s solution even worked to Arctor’s unreasonable requirements.


#18

Franks’ was particle based…no scrubing etc…it’s not something that a character animator could use as a regular prop - though it is stilll quite smart :slight_smile:


#19

exactly, there were several nice and smart solutions in there but the main requirement in this thread is that the cube has to be easely animatable…

cheers


#20

I think we’re splitting straws here. In my mind, there was at least one solution that was significantly easier to animate than otherwise if you were told to animate a Rubik’s cube.