☘️ This is a webgl/nodejs experiment project for n order Rubik's Cube.
c3cube_core.js
, the status encoding and operate for cubec3cube_solve.js
, algorithms to sovle cube problem (todo)c3cube_graphic.js
, rendering the cube bythree.js
Online Demo: C3Cube
We try to use this for understanding how cube status changes. You can dump/load operates or status to record for future use. Also it is compatible with the mobile phone to play.
- left button point on backgroud to rotate scene
- wheel to zoom in/out
- right button point on backgroud to translate camera
- left button point on cube piece and then mouse to another piece, release mouse to operate cube
- one figer point on backgroud to rotate scene
- two figers point on backgroud to zoom in/out
- two figers point on backgroud to translate scene
- one figer point on cube piece and then mouse to another piece, release mouse to operate cube
We define the piece is the unit piece on the cube surface. There are 3 types of piece: corner, edge, inner piece. We can see 3 colors on corner piece, 2 colors on edge piece and 1 color on inner piece. In n-order Rubik's Cube (n-cube), there are
There are 6 faces in cube, as front, back, left, right, up, Down, which make the face collection
We put the n-cube (n>=3) center to
We use
In this equation,
If
The operation on cube is that rotate a plane 90° by an axis. The piece on this plane are rotating together. We use
Here are some operation denote methods:
a. RLUDFB Notation (Singmaster symbol)
<R|L|U|D|F|B>[reverse][times]
For example, RUR'URU2R'
b. XYZ Notation
<X|Y|Z>(I, [times])
For example, X(2)X(-2)Y(2, 2)Y(2, -1)
todo
These examples are about innercorner surface piece 3-cube The corner piece:
color | position | orientation |
---|---|---|
RYB | ( 1, 1, 1) | ( i, j, k) |
RYG | ( 1, 1,-1) | ( i, j,-k) |
OYB | (-1, 1, 1) | (-i, j, k) |
OYG | (-1, 1,-1) | (-i, j,-k) |
OWB | (-1,-1, 1) | (-i,-j, k) |
OWG | (-1,-1,-1) | (-i,-j,-k) |
RWB | ( 1,-1, 1) | ( i,-j, k) |
RWG | ( 1,-1,-1) | ( i,-j,-k) |
The edge piece:
color | position | orientation |
---|---|---|
RNB | ( 1, 0, 1) | ( i, j, k) |
NYB | ( 0, 1, 1) | ( i, j, k) |
ONB | (-1, 0, 1) | (-i, j, k) |
NWB | ( 0,-1, 1) | ( i,-j,k) |
RYN | ( 1, 1, 0) | ( i, j, k) |
OYN | (-1, 1, 0) | (-i, j, k) |
OWN | (-1,-1, 0) | (-i,-j, k) |
RWN | ( 1,-1, 0) | ( i,-j, k) |
RNG | ( 1, 0,-1) | ( i, j,-k) |
NYG | ( 0, 1,-1) | ( i, j,-k) |
ONG | (-1, 0,-1) | (-i, j,-k) |
NWG | ( 0,-1,-1) | ( i,-j,-k) |
The inner piece:
color | position | orientation |
---|---|---|
NRN | ( 1, 0, 0) | ( i, j, k) |
NYN | ( 0, 1, 0) | ( i, j, k) |
NBN | ( 0, 0, 1) | ( i, j, k) |
NGN | ( 0, 0,-1) | ( i, j,-k) |
NWN | ( 0,-1, 0) | ( i,-j, k) |
NON | (-1, 0, 0) | (-i, j, k) |