Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: ForumAE BasicsAE ExpressionsTutorialsArticlesPodcastsMotion GraphicsTrainingCinema 4D

Rubik's Cube

Cow Forums : Adobe After Effects
Rubik's Cube
by JensVanhoof on Dec 13, 2006 at 4:48:16 pm

Hi,

I'm constructing a Rubrik's cube with video footage in After Effects. I created 54 layers, one for each square. When I'm trying to make the upper row rotate, it works just fine. I select all the components for that layer and I'm rotating them 90

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Steve Roberts on Dec 13, 2006 at 5:14:42 pm

The Rubik's cube presents the classic "dynamic parenting" issue. The only way that I've found to solve it is to fake it by creating different animated states of rotation that are not connected, then rendering each animation with a lot of motion blur, then dissolving between the states. If the rotations are fast, you get a zip-zip-zip effect. Oh, and that was in Lightwave. :)

But if they want it to be slow, and they want to see every face, you're in for a hard, if not impossible time.

Anybody else?

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Tyler Paul on Dec 13, 2006 at 5:37:04 pm

Holy crappers, talk about collective conciousness. Not an hour ago I was sitting in a waiting room thinking "I wonder if I could make a Rubiks Cube". I enter my apartment and BAM there's your post. Good luck on finding a solution I'll be thinking about it as well.





* * *

"Life Should Come With Backround Music"

-Brown Sugar Studios-


Tyler Paul's Toonificator V3.0 - Example Clip



Respond to this post   •   Return to posts index


Re: Rubik's Cube
by Mylenium on Dec 13, 2006 at 6:27:24 pm

*lol* I'd give up right now if I were you, Tyler. Thing is, you cannot animate more than 2 twists at a time, after that everything goes boom and becomes unmanageable. You really can only combine multiple compositions where one's end state represents the starting point for the next two moves. Think of this: For every move there are either 18 (3 squared cube) or 32 (4 squared cube) possible positions for each face with the next move. So after only 2 moves, you have close to 1000 possibilities, where your face can end up with the following move (4 squared cube). Like Steve said - this represents a major parenting dilemma that cannot be solved regardless of what tools you use.

Mylenium

[Pour Myl

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by yikesmikes on Dec 13, 2006 at 7:26:57 pm

It's not AE (java script I think), but somebody dood it.
Rubik's Virtual Online 3x3 Cube

http://www.rubiks.com/lvl3/index_lvl3.cfm?lan=eng&lvl1=commun&lvl2=cbegam&l...

Click the Play Now, then wait til it stops spinning.

Then click Scramble, then Solve and the double arrow key, it's trippy.



Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Mylenium on Dec 13, 2006 at 7:59:43 pm

Yes, the underlying math isn't that complex, but it is still difficult to implement. Thing is you always need to know where each cube is and which faces are currently side by side. Not impossible to do with expressions, but probably extremely slow.

Mylenium

[Pour Myl

Respond to this post   •   Return to posts index


Re: Rubik's Cube
by Tyler Paul on Dec 13, 2006 at 7:46:49 pm

I'll just throw my thoughts out here and see if anything sticks but alas your most likely right.


You've got 26 comps for each indivisual cube

You could use the nine expression plugins for layer selection to represent the cubes on a specific side. Which side you would like turn will also be set buy an expression plugin of some kind. Even a numerical value to represent the front back left.... would work

The position of each cube will always land on specific points on a 3X3X3 grid.

By using the current positions, layer selection, and expressions you can asign which 9 comps you'd like to parent together and then spin them.

When the spin is complete all nine cubes will again land on those specific points on the grid and you can reassign spin again.


Anyone think that might work or see where I would hit a snag?





Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Mylenium on Dec 13, 2006 at 8:04:41 pm

Yes, it might work, though it's still a lot of hand animation and manually setting parameters. I'd probably look for a solution based on mutually exclusive conditions - if cube X is here and Cube Y is there, then cube Z must be in the middle and act as the rotational center. Like I said in the other post, it's not unsolvable, but pretty complex.

Mylenium

[Pour Myl

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Tyler Paul on Dec 13, 2006 at 8:34:19 pm

Complex indeed, I'll have it done by tonight






...maybe

Respond to this post   •   Return to posts index


Re: Rubik's Cube
by Dan Ebberts on Dec 13, 2006 at 9:19:13 pm

Sounds like fun. Here's how I'd approach it. You really only have 22 pieces - 8 corners, 8 sides and 6 centers. The centers are easy because the don't move - they just rotate.

I don't think I'd use any parenting except to keep the three faces of a corner piece or the two faces of a side piece together. You have to keep track of the moves somehow, because the expressions won't be able to figure out their own current value without recreating the whole sequence. So I think I'd use a text layer with "standard" Rubik's cube notation of:

U = upper face
D = down, bottom face
L = left face
R = right face
F = front face
B = back face

Maybe use upper case for a clockwise turn and lower case for ccw. So a sequence of moves might look like: LFlf

For a simple scheme, where moves happen at fixed intervals, the expressions for each piece would use the text layer sequence info and the time to figure out where they should be right now in position and orientation.

Something like that.

Dan

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Tyler Paul on Dec 13, 2006 at 10:24:09 pm

I believe there are 12 sides.

The cube has 3 rows on the z axis.

Each row has 4 side blocks except that the middle row's side blocks actually appear as corners from the front view.









* * *

"Life Should Come With Backround Music"

-Brown Sugar Studios-


Tyler Paul's Toonificator V3.0 - Example Clip



Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Dan Ebberts on Dec 13, 2006 at 10:59:49 pm

You are correct sir.

Dan

Respond to this post   •   Return to posts index


Re: Rubik's Cube
by Tyler Paul on Dec 13, 2006 at 11:12:20 pm

I like the text technique and I'll definitly use it.






* * *

"Life Should Come With Backround Music"

-Brown Sugar Studios-


Tyler Paul's Toonificator V3.0 - Example Clip



Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Tyler Paul on Dec 13, 2006 at 11:37:43 pm

I'm looking for an expression that allows you to rotate a layer around another layer. Does it exist?





* * *

"Life Should Come With Backround Music"

-Brown Sugar Studios-


Tyler Paul's Toonificator V3.0 - Example Clip



Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Dan Ebberts on Dec 14, 2006 at 12:53:17 am

I think you could save yourself a lot of trouble if you set the cube up centered at [0,0,0] with the faces parallel to the xy,xz, and yz planes (you can position the camera off-axis later). Then you're just dealing with equations for circular motion in two dimensions.So, in the xy plane you'd be dealing with something like:

[Math.sin(angle)*radius, -Math.cos(angle)*radius, zOffset]

where you supply the variables angle, radius, and zOffset. The other expressions would be similar.

Dan

Respond to this post   •   Return to posts index


Re: Rubik's Cube
by accpph on Dec 14, 2006 at 2:39:28 am

Well I brute forced it. Although I like the expressions idea. I set up a simple example with each side of nine squares centered at 0,0,0. I also created up, down, front, back, right and left nulls to be have each side parented to. These in turn were ALL parented to one global null so that I could move the whole cube.

As in the posts above I comped all pertinent squares to the side that was to rotate. At the end of each 90 degree rotation, I duplicated the comp and deleted all keys in the new comp. I then re-parented to whichever controllers were about to make the next 90 degree move. And then I made the new 90 degree animation... And repeat.

Check it out at http://www.rit.edu/~accpph/media/00_ANIMATION.wmv

It's not perfect yet, but the next one will be really good.

ACC


Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Chris Smith on Dec 14, 2006 at 7:09:53 am

Cinema 4D will do animated parenting :) You could try it in that.



Chris Smith
http://www.sugarfilmproduction.com

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Joel Hooton on Dec 14, 2006 at 12:17:30 pm

I have already made one of these. I setup precomps for each "box". Then I manually keyframed a rotation. Then, did it again. I have about 5 or 6 rotations done. Each side is its one comp so I can edit or animate each side individually. It was a while ago and I just wanted to see if it could be done. I will upload it after work. I made it in AE 5.5.

I also made a foldable paper airplane that i just have not posted yet. I might do that too.

Joel

Respond to this post   •   Return to posts index


Re: Rubik's Cube
by Steve Roberts on Dec 14, 2006 at 12:19:31 pm

You guys are making me eat my words ... :)

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Tyler Paul on Dec 14, 2006 at 8:08:10 pm

Very nice. I can't wait to see the final.



I had already had my cube set at (0,0,0) so that was nice. I also had the sides spinning but Dan's expression seemed like a better idea so I went with it. The boxes are all set at (0,0,0) and I have used 2 radii values depending on whether they're a Side or Corner piece. I divided the Degrees by 57.295 to get the radians because I couldn't get toRadians() to work so that's my first question.

Now I'm coming up to the part that made making the cube so hard in the first place and that's keeping track of all the cubes. In programming I'm used to being able to add varaibles to a parameter and that amount sticking. (Example: a=a+1 and a will remain at that value until you tell it otherwise) If this were the case I'd be able to figuare out what boxes made up a face twist them around drop them, Choose a new face and again look at box positions to find the correct boxes for a face twist etc. With expressions as soon as I let go of a box (I change which face I'd like to control) the boxes reset to their original values.

My current idea is each box has an angle control for the 6 faces of the cube. Degrees are added to or subtracted from depending on the turns I tell it to make. This would allow me to keep track of every twist and turn a box has gone through. How can I make the angle controls count up 45 degrees and then stay there. I'm pretty sure I'll end up with the same problem as I had just moving the boxes and expecting them to stay.

Are their any other ideas?









* * *

"Life Should Come With Backround Music"

-Brown Sugar Studios-


Tyler Paul's Toonificator V3.0 - Example Clip



Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Joel Hooton on Dec 14, 2006 at 9:55:29 pm

Here is the video








Each corner, side and middle of the cube is its own sub comp. They are parented to a Null and ALL of the are keyframed each roation. Each side has its own precomp so you can vary the picture or video or whatever for each. If you go to each the precomp for each side and look at Solid 1 there are numbers. Turn on these numbers when keyframing the main cube. It helps to identify what you are looking at when keyframing. Here is the AEP fiel
http://jmhooton.iweb.bsu.edu/joel/rubix%20cube%203x3x3.aep

Email me or post back if you have any questions

dzlqps(at)msn.com


Respond to this post   •   Return to posts index


Re: Rubik's Cube
by Joel Hooton on Dec 14, 2006 at 9:56:12 pm

Here is the video








Each corner, side and middle of the cube is its own sub comp. They are parented to a Null and ALL of the are keyframed each roation. Each side has its own precomp so you can vary the picture or video or whatever for each. If you go to each the precomp for each side and look at Solid 1 there are numbers. Turn on these numbers when keyframing the main cube. It helps to identify what you are looking at when keyframing. Here is the AEP file
http://jmhooton.iweb.bsu.edu/joel/rubix%20cube%203x3x3.aep

Email me or post back if you have any questions

dzlqps(at)msn.com


Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Jim Zito on Dec 14, 2006 at 11:17:19 pm

I've gotta say Joel, I'm very impressed. Nice job. Also, the link to the AEP file didn't work for me.

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Joel Hooton on Dec 15, 2006 at 1:33:24 am

I just right clicked and downloaded it to my desktop

Respond to this post   •   Return to posts index


Re: Rubik's Cube
by yikesmikes on Dec 15, 2006 at 3:21:03 am

I don't get the link either, it says it's unavailable, could it be because it's a school site and you're within it?

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by lasvideo on Dec 15, 2006 at 4:45:20 am

ditto

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Joel Hooton on Dec 15, 2006 at 1:01:44 pm

It is my brothers account. I just have the password so I can upload stuff. I tried this link by copying it into another browser. It woked for me.

Any questions post here or email dzlqps(at)msn.com

http://jmhooton.iweb.bsu.edu/joel/rubixcube.zip

Respond to this post   •   Return to posts index


Rubik's Cube hehehe
by Noizzz on Dec 16, 2006 at 1:54:36 am

Truly...Rubic's cube keeps coming back,... what log?

GrtZ
NoiZ

Respond to this post   •   Return to posts index

Re: Rubik's Cube
by Bubunya on Nov 6, 2007 at 5:24:20 am

So did any one finished Rubik's cube in AE?
I'm stuck..:O)

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]