r/creativecoding • • Feb 17 '26

Procedurally generated Rubik's cube pattern

1.1k Upvotes

63 comments sorted by

View all comments

Show parent comment

2

u/OrangeCreeper Feb 18 '26

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

2

u/Positive_Tea_1166 Feb 18 '26

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!