In 2012, after fighting with Win32/MFC for far too long while working on tools at id Software, I was really excited about Qt, the cross-platform application framework, and decided to revisit an old project of mine.
The project stemmed from a computer graphics assignment where the goal was to create two C++/OpenGL programs from scratch: one that could display a model of a 3D maze, and another that would let the user walk around in the same 3D model. I also added the ability to author the maze in the app visually, collision detection and reaction, and the ability to jump and adjust the field of view while in first-person view.
Porting the GUI code to Qt made it quite easy to combine all the tools into one application and simplify the maze creation process overall. Now the user can see the results in real-time while editing the maze and quickly get a first-person preview.
At the bottom of this page I’ve included links to the source code for this project. Here is a screenshot of the application after the Qt conversion:
To use this application to design and explore a 3D maze, you would first draw the maze in its flat 2D representation in the left pane as I’ve demonstrated here:
As the maze is edited a 3D version of the maze is shown in the right pane. The width and height of the walls of the 3D maze can be adjusted using the sliders at the top of the application. Through menu options the textures used for the floor and walls of the 3D maze can be changed:
The maze in the 3D view can be rotated, translated, and scaled and the camera angle can be distorted:
Selecting the menu option ‘View|Explore Maze In First Person’ will open a dialog that lets you step inside the maze in a first person fashion. The custom textures are applied in this mode as well:
And while in first person view, you can move around the maze (within the boundaries of the walls), jump, and distort your field of view:
The source code for this project is available on GitHub here. On that site you can browse the source code and view documentation on how to download the source code and build this application yourself.