I understand your point of view, and you are completely right when you say that the problem is rotating it. That is why, the closer I can find how it works in reality, the closer I am so solving the problem "getting a working algorithm".

That is a much simpler representation, but then again, the problem of rotating it comes in the way. But if i have the [3][3][3] matrix, i can use simple matrix rotations. I've been googling around and found these solutions for the rotation:

c# - How to Rotate a 2D Array of Integers - Stack Overflow

java - Rotate array clockwise - Stack Overflow

I think they would work with the cube.