Rubiks Cube2
Rubiks Cube2
IOE,PULCHOWK CAMPUS
SUBMITTED BY:
AARBID BHATTARAI (078BCT002)
AAYUSH REGMI(078BCT005)
ADITYA RIJAL (078BCT008)
AWISKAR POKHREL (078BCT023)
SUBMITTED TO:
DEPARTMENT OF ELECTRONICS AND
COMPUTER ENGINEERING
JULY, 2024
Acknowledgement
We would like to express our heartfelt appreciation to our teacher Er. Shanti Tamang Ma’am
opportunity to develop this project, which will not only strengthen our
skills.
This project will enable us to apply the theoretical knowledge we have acquired in
valuable guidance and feedback. Any suggestions you provide will be highly
appreciated.
Abstract
This project presents a 3D Rubik's Cube simulator developed using Python, Pygame,
and OpenGL. The simulator allows users to interact with a virtual Rubik's Cube,
enabling rotations and standard cube manipulations through keyboard inputs. The
project aims to provide an educational tool for learning Rubik's Cube algorithms
for smooth rotations and uses OpenGL for rendering 3D graphics, offering
Objectives
The main objectives of our project are as follows:
Introduction
Rubik's Cube is a popular 3D combination puzzle that challenges players to align
faces of the cube to a uniform color. This project aims to create a virtual Rubik's
Cube using Python and OpenGL, allowing users to practice and visualize cube
application.
Application
The primary application of this project is educational. It serves as a learning tool for
1. Pygame Setup:
• Initialize the Pygame library for handling the display and user inputs.
1. OpenGL Setup:
• Configure OpenGL settings, including depth testing and perspective
projection.
• Use gluPerspective for setting the field of view and glTranslatef for
positioning the cube in the scene.
Quaternion Mathematics
• Implement quaternion operations for smooth and accurate 3D rotations.
Rendering
• Use OpenGL functions (glBegin, glEnd, glVertex3fv) to draw the
cube's edges and colored faces.
Event Handling
• Capture and process keyboard and mouse inputs using Pygame.
• Implement key bindings for rotating the cube and performing standard
Rubik's Cube moves.
were conducted, leading to the development of reliable quaternion operations for the
project.
blocking techniques to manage user inputs and update the display seamlessly.
Limitations and Future Enhancements
Limitations
• Basic UI: The user interface is minimal and can be improved for better
usability.
Future Enhancements
• Mobile Compatibility:
Extend the project to support mobile devices for a broader audience.