I want to rig a Rubik's cube in Maya, so it can rotate in any direction and any number of times. Any rotation would be in 90 degree increments. These are the objects in my Outliner:
26 blocks (the center block of the cube is not necessary) 9 rotation controllers (3 for the rows/columns of height/width/depth) 1 root controller
The trick is passing the control of the individual blocks from one controller to the next. At any given time, a block can be influenced by 3 different controllers. However, after rotation, the controllers change.
I suppose I need to create a series of matrices (2D arrays), 9 of them - one for each controller. Assign the blocks to them, and then reassign after a rotation. I suppose I would need a temporary matrix for swapping. Beyond this, I don't know how to go about this. Should these matrices be a parameter of the root controller? Probably.
Any help in this matter would help. I am new to MEL but I have background in C/C++ and such. How would you rig a functional Rubik's cube?
All you need is to turn the rotation interpolation to quaternion interpolation for your rotation, then key one packet at a time. Just make sure never go backwards when your keying the sequence tough.