RubikQuat is a 3D Rubik Simulator program, written entirelly in Python by means of Pygame modules. A simple 3D-Engine is implemented using only the basic 2D-graphics. The orientation in space and rotation is calculated using Quaternions. The purpose for which RubikQuat was created:
- Learn Python and experiment with Pygame
- Study Rubik's mechanics
- Research Quaternions
- Implement simple 3D-Engine
Using python:
$ python -m rubikquat_src
Under Windows: There is a build for Windows (using py2exe) which allows to run the application even without Python. Unpack the content of the build_zip folder and execute .\build\rubikquat.exe.
Help screen is displayed when RubikQuat application starts. It can also be invoked each time by pressing the F1 Key or clicking the '?'-button (top-left). Press Esc or mouse left-click to close the help and return to Rubik screen.
Key | Function | Key | Function |
---|---|---|---|
L | Flip Left-Face clockwise | Left | Rotate Rubik along Y-axis |
Shift+L | Flip Left-Face counterclockwise | Right | Rotate Rubik along Y-axis |
R | Flip Right-Face clockwise | Up | Rotate Rubik along X-axis |
Shift+R | Flip Right-Face counterclockwise | Down | Rotate Rubik along X-axis |
F | Flip Front-Face clockwise | Pg-Up | Rotate Rubik along Z-axis |
Shift+F | Flip Front-Face counterclockwise | Pg-Down | Rotate Rubik along Z-axis |
U | Flip Top-Face clockwise | Ctrl+Z | Undo the last move |
Shift+U | Flip Top-Face counterclockwise | Ctrl+Y | Redo a move |
F1 | Show Help | S | Scramble the Rubik |
You can also do all the above actions by clicking with mouse on corresponding button. Rotate the Rubik using mouse - just drag the Rubik in the direction you want to rotate it. The mouse-wheel rotates the Rubik along Z-axis.
Clean the build:
> make clean
Build the .\build\rubikquat.exe using py2exe:
> make setup
Virtual environment:
> virtualenv venv
> venv\Scripts\activate
> pip install -r requirements.txt
GNU GPL3. See the LICENSE.md file for details.
Igor Marinescu