I am trying to create a Rubik's Cube using the Animation Nodes addon. The aim is to be able to make a specific sequence based on a custum group node system.
They could be a node for each individual action, like turn the top. (you are going to have the option to turn it left or right with a boolean option).
The main problem to solve is how do you know which cubes to move when you make an action? I solved this problem with no errors by making a custom group recognizing the layers depending on the positions of each cube.
This does work really well but the problem I currently have is I am not really used to use the an matrices. I tried to make a prototype in order to make the layer rotate around the center, but the problem is the animation seems to cumulate on each frame and you can't go back by returning to the first frame.
If you could help me to find a solution for my non knowledge of the matrix system this would be really helpful.
Maybe the approach I am using to create this is not the most efficient one...
I tried my best to fix the matrix problem and found an other approach which is parenting every cube of a face / layer to the center cube of the layer (unlike the real Rubik's, there is still a center cube in order to control mid layers).
I created this custom node group, and when I animate the rotation of a center cube after linking the correct cubes to it, it works well!
But if I try to make it a group and then put two one after the other, the animations get cumulated, and you have both of the rotation occuring at once. Also this make the rotation of the linked cubes happen a strange way, and I didn't figure out why.
I provided some text help in the blend file to help you understand the project without going through each individual node because the project is a little bit complex now.