PDA

View Full Version : Rigging a Rubik's cube


acdx
12-25-2005, 04:38 PM
Hello

I'm working on a Rubik's cube and I was wondering what would be the best way to get it to actually work like a real cube for animation. Should I use MaxScript for this? I've done a search through the forums for the solution, but I didn't find a working one.

acdx
12-25-2005, 06:55 PM
Also

I've tried setting the pivots of the cube pieces with maxscript, and also reparenting them, but you can't reparent/repivot objects during animation, can you? So that works for stills, but not in animation. Or is there a way to override that, meaning making it possible to reparent/repivot objects during animation?

in your sofa
12-25-2005, 08:21 PM
my best advice is to have the cubes grouped in groups of 9 (a plane of cubes) for all possible "planes" then set up controllers to correspond to the groups of cubes using point helpers and wire parameters (rotation of this point helper will control this rotation of this "plane" of cubes).

Dominique
12-25-2005, 09:55 PM
Maybe just animate, depends on the kind of animation, but afterwards just fill in the colors,http://forums.cgsociety.org/images/icons/icon4.gif

this might be easier,http://forums.cgsociety.org/images/icons/icon10.gif
cheers,
Dom

acdx
12-25-2005, 10:45 PM
Maybe just animate, depends on the kind of animation, but afterwards just fill in the colors,http://forums.cgsociety.org/images/icons/icon4.gif

this might be easier,http://forums.cgsociety.org/images/icons/icon10.gif
cheers,
DomThat's the thing.. I can't just animate, because I need to move the layers both horizontally and vertically. But I'll review the other suggestion

RockinAkin
12-25-2005, 11:01 PM
Theres an on-going thread about this in the Rigging section:
http://forums.cgsociety.org/showthread.php?t=297907
:thumbsup:

Blue
12-25-2005, 11:15 PM
[/url][url="http://www.effectware.com/download/max6/efx_rubik.zip"][Utility] Rubik's Cube Animator 2.0 Beta2 (http://www.effectware.com/cgi-bin/php/ViewPlugList.php?lang=1&mode=0&ver=6)
This program is a utility which creates and animates the Rubik's Cube.

Made by effectware (http://www.effectware.com/)

Rens
12-25-2005, 11:32 PM
my best advice is to have the cubes grouped in groups of 9 (a plane of cubes) for all possible "planes" then set up controllers to correspond to the groups of cubes using point helpers and wire parameters (rotation of this point helper will control this rotation of this "plane" of cubes).
The problem with this is that the groups will break apart after a few turns. For example when you rotate the top horizontal 'plane' and then rotate one of the middle vertical planes the top horizontal plane won't have the same cubes anymore.

Had an idea and just tested a crude version with two rotations but it seems to work so far:

What you do is you make nine FFD Boxes and rotate those.
- Make sure your cubes are all in the same object or group.
- Apply the FFDs. Each one will be one of the 'planes'. Make sure the nine (sides) or eight (middle) cubes fit inside each of the FFDs. So when you rotate your FFDs only one plane of cubes will move.
- So scale and position the FFDs. Make sure your Rubick's Cube is 100% symmetrical in all directions and that the FFDs are nicely centered.
- Just select the Control Points sub-object of the FFD and rotate it. The cubes should move. Select the next FFD and the cubes inside of that one should move with that FFD.

To me this seems to be the easiest and most practical solution. No scripting needed. Time to set it up shouldn't be that long either.

Hope this helps!

- Rens

acdx
12-25-2005, 11:41 PM
Thanks for the responses, I'll look into those too :D

I read some of the suggestions in the other rubik's cube thread, and someone suggested setting the cubes' pivots to the world origin and then rotate in global mode, how does this actually work? The guy said he got it working

For some reason my post didn't come through earlier, what I said was, that I also tried setting the pivots and reparenting the cubes with maxscript, but it didn't work for animation, because you can't animate pivots separate from the object, nor can you reparent objects in animation, can you?

EDIT:

The Rubik's cube animator plugin looks nice (haven't downloaded it though), but I'd like to actually be able to create and get the cube working myself and not use extra utilities

Rens
12-26-2005, 12:13 AM
Ugh, getting back to max after four months of XSI is tough. :/

I just set up a whole Rubick's Cube with the FFDs and it works. There was a problem though and that was with the hierarchy of the modifiers, the lower FFDs didn't take the geometry from the top ones.
A fix for this is to drag the FFD you want to animate to the top and then rotate the points.
Also make sure that the FFDs are perfectly centered! Otherwise your cube will mess up after a few turns... *cough*

Another solution might be to use FFD space warps instead of modifiers. Make sure to link them to your object if you want to animate the whole cube.

So this might be a nice option of you want to rig it yourself. The plugin might be a quicker option though.

- R

acdx
12-26-2005, 12:50 AM
How do i get the ffd:s exactly centered? I tried doing that, but they probably were not centered, lol..

see image: http://img494.imageshack.us/img494/5310/kuva1zo.gif (http://img494.imageshack.us/img494/5310/kuva1zo.gif)

I used space warps.. I thought that's what you were talking about all the time

Rens
12-26-2005, 01:00 AM
I aligned the middle FFD to the center of the whole cube. Then I shift-dragged the other two to the edges as they need to be aligned on one axis only (rotation axis).

But I set up a whole cube using space warp FFDs and it seems to work fine untill I animate it. As your animating the control points the points move from one point in space to another instead of the whole FFD rotating. This results in a squashing of the cubes halfway. :shrug:

I'll try to figure that out.

CGTalk Moderation
12-26-2005, 01:00 AM
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.