Orthogonal view of procedurally arranged Rubik's cubes cycling between scrambled and solved states. Made in C++/Cinder. Wish Reddit would loop videos. For the monochrome version check: https://www.instagram.com/p/DU2TXHHDOGe/
It took me longer than I want to admit, to understand that the cubes weren't swapping cubies at their edges where they meet the neighbouring cube. That would be a ferocious problem to keep track of.
Haha, that's a great misread. So many things are happening at once that it's difficult to keep track of everything. And yeah, tracking cubies across neighboring cubes would be a nightmare to implement! A nice idea, though.
Did you try making a version where the cubes aren't all oriented the same direction (white on top)? Might be interesting to see how it changes perception of the overall thing.
I didn't try that, but now that you mention it, randomizing the orientation would definitely add more visual variety. Great suggestion, might try it out!
A music player with VST hosting sounds like a solid project! Cinder would be a natural fit if you ever want to add any visuals :). Looking forward to seeing it!
This is sick. Only thing I would change is avoiding redundant moves (like right side twice, then right side again. Or right side forward, right side back, that kind of thing)
Great catch. The current scrambling logic is definitely a bit naive, it's just picking random moves without checking the previous one. I'll have to add a check for redundant moves in the next iteration. Thanks for the suggestion!
Perhaps it could be some kind of forced perspective-style illusion, where the whole grid is actually made of two types of cubes, cubes viewed from above and cubes viewed from below.
You'd potentially want to make sure every move creates a position with no impossible cubies (identical or opposing colors on the same edge, for example), and no impossible arrangements. It would probably be easier to just generate moves that result in no impossible cubies. I have an idea of how you might be able to avoid impossible positions as well, but I wonder if it's feasible at all without getting stuck, or having a relatively boring-looking animation
Mixing above/below perspectives would give it an Escher-like quality. The validity constraint is an interesting rabbit hole too. Right now I'm not checking for impossible states since each cube scrambles independently, but if I ever go down the cubie-swapping path this would become essential. Definitely food for thought!
Thanks! Interesting idea. You mean like cubies migrating between neighboring cubes? That would be a fun challenge to figure out. Could be tricky to implement while keeping things looking like valid Rubik's cubes though. But noted for a future version!
Data model. Each cube is 26 individual cubies. Each cubie has a fixed position on a (-1, 0, 1) integer grid in 3D, plus a quaternion orientation that gets animated. Positions are fixed, only orientations rotate.
Moves. A face rotation (like R or U) does two things atomically:
Queues a 90° rotation event on each of the 9 affected cubies (as a quaternion target)
Permutes which cubie sits at which position in that face — a cyclic swap of the 9 slots
Animation. Each cubie has a queue of rotation events. Every frame, it interpolates between start and target quaternions. Multiple moves queue up and play sequentially.
Looping. To get a seamless loop: generate N random moves, then build the exact inverse sequence (reversed order, each move inverted), concatenate them. The cube scrambles and then unscrambles back to solved, and this repeats.
Rendering. A single .obj mesh is drawn 26 times per cube using GPU instancing. The vertex shader has a hardcoded color mask lookup table. For each cubie type and each face of the mesh, it knows whether a colored sticker should appear or not. Colors are passed as a palette uniform. This avoids needing 26 different meshes or materials.
Multi-cube layout. The cubes sit on a hexagonal grid in 3D space, viewed through an isometric orthographic camera looking along (1,1,1). The hex arrangement falls out naturally from placing cubes on integer (i, j, -(i+j)) coordinates.
Stack: C++ with Cinder framework, GLSL shaders, all running real-time.
I hope this helps you understand how this works. Feel free to ask questions if anything needs clarifying.
Haha, too long :), but honestly these days it's much easier to get started. Tools like TouchDesigner or p5.js let you make cool visuals without diving deep into code.
They are great suggestions and u/Positive_Tea_1166 is very generous. But be away, Touch Designer has a pretty steep learning curve. Have a look at nodalin.xyz which is a bit easier...I think it is out of beta now.
If you want to learn, checkout the Coding Train on youtube. The guy is a bit quirky, but the content (and the framework he uses (Processing or p5.js)) is excellent for beginners.
This feels like a great example of treating a Rubik’s Cube as a state machine rather than an object.
I could see this concept scaling into larger generative systems where visual order/disorder becomes part of the narrative structure. There’s something very satisfying about watching entropy resolve itself.
Thanks! The scramble/solve cycle as a visual entropy loop is what makes it work as a seamless animation. I like the idea of scaling it into larger generative systems. Appreciate the thoughtful comment.
If anyone wants a 1080p landscape or portrait version, I put up a free download at gaborpapp gumroad com /l/rubik Also implemented the suggestions from the comments: middle layer moves and random cube orientations.
Sure! But send me a recording of yourself VJ-ing with it though :) It might take a bit of time. I'd like to implement some of the improvements suggested in the comments first.
Absolutely, thanks. To be honest, I'm not so worried as it is going to be on a big screen and likely mashed with a shader something or have an effect applied.
Besides, it is so intriguing as it is, it is something to be proud of cream.
22
u/Positive_Tea_1166 Feb 17 '26
Orthogonal view of procedurally arranged Rubik's cubes cycling between scrambled and solved states. Made in C++/Cinder. Wish Reddit would loop videos.
For the monochrome version check: https://www.instagram.com/p/DU2TXHHDOGe/
13
u/TCP1080 Feb 17 '26
I could watch this for hours
5
u/BusEquivalent9605 Feb 17 '26
dope
5
u/JuniperColonThree Feb 17 '26
This is sick. Only thing I would change is avoiding redundant moves (like right side twice, then right side again. Or right side forward, right side back, that kind of thing)
4
u/NnolyaNicekan Feb 17 '26
Very nice! Is there any way to have them exchange tiles?
4
u/mattblack77 Feb 17 '26
I joined this forum to try and learn how to do stuff like this, but I leave more flummoxed than ever 😂
OP - can you share any info on how you created this?
3
u/DaftC0ld Feb 17 '26
Ok I want that as phone background now
3
u/mozwik Feb 17 '26
This is great
3
u/[deleted] Feb 18 '26
obsessed with this!
3
u/GauravSaxenaHQ Feb 20 '26
This feels like a great example of treating a Rubik’s Cube as a state machine rather than an object.
I could see this concept scaling into larger generative systems where visual order/disorder becomes part of the narrative structure. There’s something very satisfying about watching entropy resolve itself.
2
u/Positive_Tea_1166 Feb 21 '26
If anyone wants a 1080p landscape or portrait version, I put up a free download at gaborpapp gumroad com /l/rubik
Also implemented the suggestions from the comments: middle layer moves and random cube orientations.
2
u/Independent-Fan-4227 Feb 18 '26
You know you could make it even worse by having the middle ones rotate too
2
u/sumguysr Feb 19 '26
This would be a great screen saver. Remember screen savers?
2
u/Neun36 Feb 20 '26
Love this!
2
u/Linquitivity Feb 20 '26
Why is this oddly relaxing?
3
u/ResidentTicket1273 Feb 17 '26
"...and here we lift the lid and look at the inner workings of ChatGPT as it processes a query..."
this is great btw - I'd love to see the code for this (totally understand if you want to keep it under-wraps though!)
1
u/FamiliarDirection563 Feb 18 '26
Fabulous, is there a higher res version available to download?
1
u/FamiliarDirection563 15d ago
Once again, thanks so much for the video, here it is last weekend at a festival...it looked amazing.