Is there a way to automate the parent setting of a layer? On the cube itself, as someone previously mentioned, each block has a specific grid assignment in x,y,z space. Since the center square on a side only rotates, you can parent all of the other 8 blocks that make that side to the center square. Then by rotating the center square in 90-degree increments, you get a full rotation. Not rocket science, I know. The obvious result is that the 8 child blocks have new xyz grid assignments but their position doesn’t change…until you un-parent them. Now, if you set the parent status of the blocks on another side to that side’s center, you get the same result. I’m sure you’ve all done this, so I shall not insult your intelligence…:)
Here’s the question: can you dynamically change the parent status of each of the blocks according to their xyz coordinates?
Create your 26 “blocks” which make up the cube, each 100x100x100.
Position your cube center to [0,0,0].
Parent the center block of each side to the cube’s center.
Don’t parent the other 20 blocks to anything.
For best explanation, I will use color codes to describe each block (ie. BGR is the corner with Blue, Green, and Red. RY is a middle side with Red and Yellow). Red side facing you.
The position of all blocks containing red from left to right, top to bottom are (matrix times 100):
[-1,-1,1],[0,-1,1],[1,-1,1]
[-1,0,1], [0,0,1], [1,0,1]
[-1,1,1], [0,1,1], [1,1,1]
As you can see, the only value that remains constant on this side of the cube is the z-value (in this case, 100). And no matter how you rotate sides, so long as the non-center blocks are un-parented, the side containing the red center block will always have a z-value of 100. And each of the other 5 sides will always have exactly one constant x, y,or z value as well. So…..
Is there a way to dynamically parent (or otherwise connect) that constant value to a given side’s center? If so, when you rotate a center, it can look at the values of the constant (in the example, the z-value) to determine if each block would be affected by rotating the center block. In coding language, the red-centered block could do this:
L=layers of the individual blocks
examine L.position[2];
if layer L position[2]=100 then parent that layer to the red center;
rotate the red center 90/180/270 degrees (and therefore rotating the whole side);
un-parent layer L
This would leave all the blocks on the 3D grid in place for the next side’s rotation. And it would not allow for any blocks to rotate until they have reached a complete 90/180/270 degree rotation, thus avoiding a Rubik’s explosion.
I don’t know how to write this in expressions, and that is why I am here. Hopefully it will shed some insight for others who are looking to solve this problem…including me!